<!--本Demo登陆测试帐号：1c1c，密码：111, 测试账号：1v1v，密码：123456-->
<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="edge" />
    <title>环信测试demo</title>

    <script >
        /**
         * git do not control webim.config.js
         * everyone should copy webim.config.js.demo to webim.config.js
         * and have their own configs.
         * In this way , others won't be influenced by this config while git pull.
         *
         */

// for react native
// var location = {
//     protocol: "https"
// }

        function getUrl(){
            var apiUrl = (window.location.protocol === "https:" ? "https:" : "http:") + "//a1-hsb.easemob.com"
            var xmppUrl = "im-api.easemob.com"
            if(window.location.href.indexOf("webim-h5.easemob.com") !== -1 || window.location.href.indexOf("localhost") !== -1 || window.location.href.indexOf("172.17.2.168") !== -1){
                apiUrl = (window.location.protocol === "https:" ? "https:" : "http:") + "//a1-hsb-ly.easemob.com"
                xmppUrl = "im-api.easemob.com"
            }
            // else if(window.location.href.indexOf("webim-hsb.easemob.com") !== -1){
            //     apiUrl = (window.location.protocol === "https:" ? "https:" : "http:") + "//a1-hsb.easemob.com"
            //     xmppUrl = "im-api-hsb.easemob.com"
            // }
            return {
                apiUrl: apiUrl,
                xmppUrl: xmppUrl
            }
        }


        var config = {
            /*
             * XMPP server
             */
            xmppURL: (window.location.protocol === "https:" ? "https:" : "http:") + "//im-api-v2.easemob.com/ws",
            // xmppURL: "im-api.easemob.com",
            // xmppURL: '172.17.2.139:5280',
            /*
             * Backend REST API URL
             */
            // apiURL: (location.protocol === 'https:' ? 'https:' : 'http:') + '//a1.easemob.com',
            // ios must be https!!! by lwz
            // apiURL: "https://a1.easemob.com",
            apiURL: (window.location.protocol === "https:" ? "https:" : "http:") + "//a1.easemob.com",
            // apiURL: (location.protocol === 'https:' ? 'https:' : 'http:') + '//172.17.3.155:8080',
            /*
             * Application AppKey
             */
            appkey: "easemob-demo#chatdemoui",
            /*
             * Application Host
             */
            Host: "easemob.com",
            /*
             * Whether to use HTTPS
             * @parameter {Boolean} true or false
             */
            https: true,
            isHttpDNS: false,
            /*
             * isMultiLoginSessions
             * true: A visitor can sign in to multiple webpages and receive messages at all the webpages.
             * false: A visitor can sign in to only one webpage and receive messages at the webpage.
             */
            isMultiLoginSessions: true,
            /**
             * Whether to use window.doQuery()
             * @parameter {Boolean} true or false
             */
            isWindowSDK: false,
            /**
             * isSandBox=true:  xmppURL: 'im-api.sandbox.easemob.com',  apiURL: '//a1.sdb.easemob.com',
             * isSandBox=false: xmppURL: 'im-api.easemob.com',          apiURL: '//a1.easemob.com',
             * @parameter {Boolean} true or false
             */
            isSandBox: false,
            /**
             * Whether to console.log in strophe.log()
             * @parameter {Boolean} true or false
             */
            isDebug: true,
            /**
             * Whether to show logs in strophe
             * @parameter {Boolean} true or false
             */
            isStropheLog: false,
            /**
             * will auto connect the xmpp server autoReconnectNumMax times in background when client is offline.
             * won't auto connect if autoReconnectNumMax=0.
             */
            autoReconnectNumMax: 5,
            /**
             * the interval secons between each atuo reconnectting.
             * works only if autoReconnectMaxNum >= 2.
             */
            autoReconnectInterval: 2,
            /**
             * webrtc supports WebKit and https only
             */
            isWebRTC: window.RTCPeerConnection && /^https\:$/.test(window.location.protocol),
            /**
             *  cn: chinese
             *  us: english
             */
            i18n: "cn",
            /*
             * Set to auto sign-in
             */
            isAutoLogin: true,
            /**
             * Size of message cache for person to person
             */
            p2pMessageCacheSize: 500,
            /**
             * When a message arrived, the receiver send an ack message to the
             * sender, in order to tell the sender the message has delivered.
             * See call back function onReceivedMessage
             */
            delivery: false,
            /**
             * Size of message cache for group chating like group, chatroom etc
             */
            groupMessageCacheSize: 200,
            /**
             * 5 actual logging methods, ordered and available:
             * 'TRACE', 'DEBUG', 'INFO', 'WARN', 'ERROR'
             */

            loglevel: "ERROR",

            /**
             * enable localstorage for history messages
             */
            enableLocalStorage: true
        }


    </script>
    <script >parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcelRequire,u="function"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i="function"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&"string"==typeof t)return u(t);var c=new Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;c<t.length;c++)try{f(t[c])}catch(e){i||(i=e)}if(t.length){var l=f(t[t.length-1]);"object"==typeof exports&&"undefined"!=typeof module?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):n&&(this[n]=l)}if(parcelRequire=f,i)throw i;return f}({"G7Dp":[function(require,module,exports) {
            "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=function(){return{nested:{easemob:{nested:{pb:{nested:{MessageBody:{fields:{type:{type:"Type",id:1},from:{type:"JID",id:2},to:{type:"JID",id:3},contents:{rule:"repeated",type:"Content",id:4},ext:{rule:"repeated",type:"KeyValue",id:5},ackMessageId:{type:"uint64",id:6}},nested:{Content:{fields:{type:{type:"Type",id:1},text:{type:"string",id:2},latitude:{type:"double",id:3},longitude:{type:"double",id:4},address:{type:"string",id:5},displayName:{type:"string",id:6},remotePath:{type:"string",id:7},secretKey:{type:"string",id:8},fileLength:{type:"int32",id:9},action:{type:"string",id:10},params:{rule:"repeated",type:"KeyValue",id:11},duration:{type:"int32",id:12},size:{type:"Size",id:13},thumbnailRemotePath:{type:"string",id:14},thumbnailSecretKey:{type:"string",id:15},thumbnailDisplayName:{type:"string",id:16},thumbnailFileLength:{type:"int32",id:17},thumbnailSize:{type:"Size",id:18}},nested:{Type:{values:{TEXT:0,IMAGE:1,VIDEO:2,LOCATION:3,VOICE:4,FILE:5,COMMAND:6}},Size:{fields:{width:{type:"double",id:1},height:{type:"double",id:2}}}}},Type:{values:{NORMAL:0,CHAT:1,GROUPCHAT:2,CHATROOM:3,READ_ACK:4,DELIVER_ACK:5,RECALL:6}}}},KeyValue:{oneofs:{value:{oneof:["varintValue","floatValue","doubleValue","stringValue"]}},fields:{key:{type:"string",id:1},type:{type:"ValueType",id:2},varintValue:{type:"int64",id:3},floatValue:{type:"float",id:4},doubleValue:{type:"double",id:5},stringValue:{type:"string",id:6}},nested:{ValueType:{values:{BOOL:1,INT:2,UINT:3,LLINT:4,FLOAT:5,DOUBLE:6,STRING:7,JSON_STRING:8}}}},JID:{fields:{appKey:{type:"string",id:1},name:{type:"string",id:2},domain:{type:"string",id:3},clientResource:{type:"string",id:4}}},ConferenceBody:{fields:{sessionId:{type:"string",id:1},operation:{type:"Operation",id:2},conferenceId:{type:"string",id:3},type:{type:"Type",id:4},content:{type:"string",id:5},network:{type:"string",id:6},version:{type:"string",id:7},identity:{type:"Identity",id:8},duration:{type:"string",id:9},peerName:{type:"string",id:10},endReason:{type:"EndReason",id:11},status:{type:"Status",id:12},isDirect:{type:"bool",id:13},controlType:{type:"StreamControlType",id:14},routeFlag:{type:"int32",id:15},routeKey:{type:"string",id:16}},nested:{Status:{fields:{errorCode:{type:"int32",id:1}}},Operation:{values:{JOIN:0,INITIATE:1,ACCEPT_INITIATE:2,ANSWER:3,TERMINATE:4,REMOVE:5,STREAM_CONTROL:6,MEDIA_REQUEST:7}},Type:{values:{VOICE:0,VIDEO:1}},Identity:{values:{CALLER:0,CALLEE:1}},EndReason:{values:{HANGUP:0,NORESPONSE:1,REJECT:2,BUSY:3,FAIL:4,UNSUPPORTED:5,OFFLINE:6}},StreamControlType:{values:{PAUSE_VOICE:0,RESUME_VOICE:1,PAUSE_VIDEO:2,RESUME_VIDEO:3}}}},MSync:{fields:{version:{type:"Version",id:1,options:{default:"MSYNC_V1"}},guid:{type:"JID",id:2},auth:{type:"string",id:3},compressAlgorimth:{type:"uint32",id:4},crypto:{type:"uint32",id:5},userAgent:{type:"string",id:6},pov:{type:"uint64",id:7},command:{type:"Command",id:8},deviceId:{type:"uint32",id:10},encryptType:{rule:"repeated",type:"EncryptType",id:11,options:{packed:!1}},encryptKey:{type:"string",id:12},payload:{type:"bytes",id:9}},nested:{Version:{values:{MSYNC_V1:0,MSYNC_V2:1}},Command:{values:{SYNC:0,UNREAD:1,NOTICE:2,PROVISION:3}}}},EncryptType:{values:{ENCRYPT_NONE:0,ENCRYPT_AES_128_CBC:1,ENCRYPT_AES_256_CBC:2}},CommSyncUL:{fields:{meta:{type:"Meta",id:1},key:{type:"uint64",id:2},queue:{type:"JID",id:3},isRoam:{type:"bool",id:4},lastFullRoamKey:{type:"uint64",id:5}}},CommSyncDL:{fields:{status:{type:"Status",id:1},metaId:{type:"uint64",id:2},serverId:{type:"uint64",id:3},metas:{rule:"repeated",type:"Meta",id:4},nextKey:{type:"uint64",id:5},queue:{type:"JID",id:6},isLast:{type:"bool",id:7},timestamp:{type:"uint64",id:8},isRoam:{type:"bool",id:9}}},CommNotice:{fields:{queue:{type:"JID",id:1}}},CommUnreadUL:{fields:{}},CommUnreadDL:{fields:{status:{type:"Status",id:1},unread:{rule:"repeated",type:"MetaQueue",id:2},timestamp:{type:"uint64",id:3}}},MetaQueue:{fields:{queue:{type:"JID",id:1},n:{type:"uint32",id:2}}},Meta:{fields:{id:{type:"uint64",id:1},from:{type:"JID",id:2},to:{type:"JID",id:3},timestamp:{type:"uint64",id:4},ns:{type:"NameSpace",id:5},payload:{type:"bytes",id:6},routetype:{type:"RouteType",id:7}},nested:{NameSpace:{values:{STATISTIC:0,CHAT:1,MUC:2,ROSTER:3,CONFERENCE:4}},RouteType:{values:{ROUTE_ALL:0,ROUTE_ONLINE:1}}}},Status:{fields:{errorCode:{type:"ErrorCode",id:1},reason:{type:"string",id:2},redirectInfo:{rule:"repeated",type:"RedirectInfo",id:3}},nested:{ErrorCode:{values:{OK:0,FAIL:1,UNAUTHORIZED:2,MISSING_PARAMETER:3,WRONG_PARAMETER:4,REDIRECT:5,TOKEN_EXPIRED:6,PERMISSION_DENIED:7,NO_ROUTE:8,UNKNOWN_COMMAND:9,PB_PARSER_ERROR:10,BIND_ANOTHER_DEVICE:11,IM_FORBIDDEN:12,TOO_MANY_DEVICES:13,PLATFORM_LIMIT:14,USER_MUTED:15,ENCRYPT_DISABLE:16,ENCRYPT_ENABLE:17,DECRYPT_FAILURE:18}}}},RedirectInfo:{fields:{host:{type:"string",id:1},port:{type:"uint32",id:2}}},Provision:{fields:{osType:{type:"OsType",id:1},version:{type:"string",id:2},networkType:{type:"NetworkType",id:3},appSign:{type:"string",id:4},compressType:{rule:"repeated",type:"CompressType",id:5,options:{packed:!1}},encryptType:{rule:"repeated",type:"EncryptType",id:6,options:{packed:!1}},encryptKey:{type:"string",id:7},status:{type:"Status",id:8},deviceUuid:{type:"string",id:9},isManualLogin:{type:"bool",id:10},password:{type:"string",id:11},deviceName:{type:"string",id:12},resource:{type:"string",id:13},auth:{type:"string",id:14}},nested:{OsType:{values:{OS_IOS:0,OS_ANDROID:1,OS_LINUX:2,OS_OSX:3,OS_WIN:4,OS_OTHER:16}},NetworkType:{values:{NETWORK_NONE:0,NETWORK_WIFI:1,NETWORK_4G:2,NETWORK_3G:3,NETWORK_2G:4,NETWORK_WIRE:5}},CompressType:{values:{COMPRESS_NONE:0,COMPRESS_ZLIB:1}}}},MUCBody:{fields:{mucId:{type:"JID",id:1},operation:{type:"Operation",id:2},from:{type:"JID",id:3},to:{rule:"repeated",type:"JID",id:4},setting:{type:"Setting",id:5},reason:{type:"string",id:6},isChatroom:{type:"bool",id:7},status:{type:"Status",id:8}},nested:{Operation:{values:{CREATE:0,DESTROY:1,JOIN:2,LEAVE:3,APPLY:4,APPLY_ACCEPT:5,APPLY_DECLINE:6,INVITE:7,INVITE_ACCEPT:8,INVITE_DECLINE:9,KICK:10,GET_BLACKLIST:11,BAN:12,ALLOW:13,UPDATE:14,BLOCK:15,UNBLOCK:16,PRESENCE:17,ABSENCE:18,DIRECT_JOINED:19,ASSIGN_OWNER:20,ADD_ADMIN:21,REMOVE_ADMIN:22,ADD_MUTE:23,REMOVE_MUTE:24,UPDATE_ANNOUNCEMENT:25,DELETE_ANNOUNCEMENT:26,UPLOAD_FILE:27,DELETE_FILE:28}},Setting:{fields:{name:{type:"string",id:1},desc:{type:"string",id:2},type:{type:"Type",id:3},maxUsers:{type:"int32",id:4},owner:{type:"string",id:5}},nested:{Type:{values:{PRIVATE_OWNER_INVITE:0,PRIVATE_MEMBER_INVITE:1,PUBLIC_JOIN_APPROVAL:2,PUBLIC_JOIN_OPEN:3,PUBLIC_ANONYMOUS:4}}}},Status:{fields:{errorCode:{type:"ErrorCode",id:1},description:{type:"string",id:2}},nested:{ErrorCode:{values:{OK:0,PERMISSION_DENIED:1,WRONG_PARAMETER:2,MUC_NOT_EXIST:3,USER_NOT_EXIST:4,UNKNOWN:5}}}}}},RosterBody:{fields:{operation:{type:"Operation",id:1},status:{type:"Status",id:2},from:{type:"JID",id:3},to:{rule:"repeated",type:"JID",id:4},reason:{type:"string",id:5},rosterVer:{type:"string",id:6},biDirection:{type:"bool",id:7}},nested:{Operation:{values:{GET_ROSTER:0,GET_BLACKLIST:1,ADD:2,REMOVE:3,ACCEPT:4,DECLINE:5,BAN:6,ALLOW:7,REMOTE_ACCEPT:8,REMOTE_DECLINE:9}},Status:{fields:{errorCode:{type:"ErrorCode",id:1},description:{type:"string",id:2}},nested:{ErrorCode:{values:{OK:0,USER_NOT_EXIST:1,USER_ALREADY_FRIEND:2,USER_ALREADY_BLACKLIST:3}}}}}},StatisticsBody:{fields:{operation:{type:"Operation",id:1},os:{type:"OsType",id:2},version:{type:"string",id:3},network:{type:"NetworkType",id:4},imTime:{type:"uint32",id:5},chatTime:{type:"uint32",id:6},location:{type:"string",id:7}},nested:{Operation:{values:{INFORMATION:0,USER_REMOVED:1,USER_LOGIN_ANOTHER_DEVICE:2,USER_KICKED_BY_CHANGE_PASSWORD:3,USER_KICKED_BY_OTHER_DEVICE:4}},OsType:{values:{OS_IOS:0,OS_ANDROID:1,OS_LINUX:2,OS_OSX:3,OS_WIN:4,OS_OTHER:16}},NetworkType:{values:{NETWORK_NONE:0,NETWORK_WIFI:1,NETWORK_4G:2,NETWORK_3G:3,NETWORK_2G:4,NETWORK_WIRE:5}}}}}}}}}}},t=e;exports.default=t;
        },{}],"5Ezc":[function(require,module,exports) {
            "use strict";function n(n,e){for(var r=new Array(arguments.length-1),t=0,l=2,o=!0;l<arguments.length;)r[t++]=arguments[l++];return new Promise(function(l,u){r[t]=function(n){if(o)if(o=!1,n)u(n);else{for(var e=new Array(arguments.length-1),r=0;r<e.length;)e[r++]=arguments[r];l.apply(null,e)}};try{n.apply(e||null,r)}catch(a){o&&(o=!1,u(a))}})}module.exports=n;
        },{}],"20Fs":[function(require,module,exports) {
            "use strict";var r=exports;r.length=function(r){var e=r.length;if(!e)return 0;for(var a=0;--e%4>1&&"="===r.charAt(e);)++a;return Math.ceil(3*r.length)/4-a};for(var e=new Array(64),a=new Array(123),t=0;t<64;)a[e[t]=t<26?t+65:t<52?t+71:t<62?t-4:t-59|43]=t++;r.encode=function(r,a,t){for(var n,i=null,o=[],c=0,s=0;a<t;){var h=r[a++];switch(s){case 0:o[c++]=e[h>>2],n=(3&h)<<4,s=1;break;case 1:o[c++]=e[n|h>>4],n=(15&h)<<2,s=2;break;case 2:o[c++]=e[n|h>>6],o[c++]=e[63&h],s=0}c>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,o)),c=0)}return s&&(o[c++]=e[n],o[c++]=61,1===s&&(o[c++]=61)),i?(c&&i.push(String.fromCharCode.apply(String,o.slice(0,c))),i.join("")):String.fromCharCode.apply(String,o.slice(0,c))};var n="invalid encoding";r.decode=function(r,e,t){for(var i,o=t,c=0,s=0;s<r.length;){var h=r.charCodeAt(s++);if(61===h&&c>1)break;if(void 0===(h=a[h]))throw Error(n);switch(c){case 0:i=h,c=1;break;case 1:e[t++]=i<<2|(48&h)>>4,i=h,c=2;break;case 2:e[t++]=(15&i)<<4|(60&h)>>2,i=h,c=3;break;case 3:e[t++]=(3&i)<<6|h,c=0}}if(1===c)throw Error(n);return t-o},r.test=function(r){return/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(r)};
        },{}],"JI1+":[function(require,module,exports) {
            "use strict";function t(){this._listeners={}}module.exports=t,t.prototype.on=function(t,s,e){return(this._listeners[t]||(this._listeners[t]=[])).push({fn:s,ctx:e||this}),this},t.prototype.off=function(t,s){if(void 0===t)this._listeners={};else if(void 0===s)this._listeners[t]=[];else for(var e=this._listeners[t],i=0;i<e.length;)e[i].fn===s?e.splice(i,1):++i;return this},t.prototype.emit=function(t){var s=this._listeners[t];if(s){for(var e=[],i=1;i<arguments.length;)e.push(arguments[i++]);for(i=0;i<s.length;)s[i].fn.apply(s[i++].ctx,e)}return this};
        },{}],"M11I":[function(require,module,exports) {
            "use strict";function n(n){return"undefined"!=typeof Float32Array?function(){var e=new Float32Array([-0]),t=new Uint8Array(e.buffer),r=128===t[3];function o(n,r,o){e[0]=n,r[o]=t[0],r[o+1]=t[1],r[o+2]=t[2],r[o+3]=t[3]}function u(n,r,o){e[0]=n,r[o]=t[3],r[o+1]=t[2],r[o+2]=t[1],r[o+3]=t[0]}function i(n,r){return t[0]=n[r],t[1]=n[r+1],t[2]=n[r+2],t[3]=n[r+3],e[0]}function a(n,r){return t[3]=n[r],t[2]=n[r+1],t[1]=n[r+2],t[0]=n[r+3],e[0]}n.writeFloatLE=r?o:u,n.writeFloatBE=r?u:o,n.readFloatLE=r?i:a,n.readFloatBE=r?a:i}():function(){function u(n,e,t,r){var o=e<0?1:0;if(o&&(e=-e),0===e)n(1/e>0?0:2147483648,t,r);else if(isNaN(e))n(2143289344,t,r);else if(e>3.4028234663852886e38)n((o<<31|2139095040)>>>0,t,r);else if(e<1.1754943508222875e-38)n((o<<31|Math.round(e/1.401298464324817e-45))>>>0,t,r);else{var u=Math.floor(Math.log(e)/Math.LN2);n((o<<31|u+127<<23|8388607&Math.round(e*Math.pow(2,-u)*8388608))>>>0,t,r)}}function i(n,e,t){var r=n(e,t),o=2*(r>>31)+1,u=r>>>23&255,i=8388607&r;return 255===u?i?NaN:o*(1/0):0===u?1.401298464324817e-45*o*i:o*Math.pow(2,u-150)*(i+8388608)}n.writeFloatLE=u.bind(null,e),n.writeFloatBE=u.bind(null,t),n.readFloatLE=i.bind(null,r),n.readFloatBE=i.bind(null,o)}(),"undefined"!=typeof Float64Array?function(){var e=new Float64Array([-0]),t=new Uint8Array(e.buffer),r=128===t[7];function o(n,r,o){e[0]=n,r[o]=t[0],r[o+1]=t[1],r[o+2]=t[2],r[o+3]=t[3],r[o+4]=t[4],r[o+5]=t[5],r[o+6]=t[6],r[o+7]=t[7]}function u(n,r,o){e[0]=n,r[o]=t[7],r[o+1]=t[6],r[o+2]=t[5],r[o+3]=t[4],r[o+4]=t[3],r[o+5]=t[2],r[o+6]=t[1],r[o+7]=t[0]}function i(n,r){return t[0]=n[r],t[1]=n[r+1],t[2]=n[r+2],t[3]=n[r+3],t[4]=n[r+4],t[5]=n[r+5],t[6]=n[r+6],t[7]=n[r+7],e[0]}function a(n,r){return t[7]=n[r],t[6]=n[r+1],t[5]=n[r+2],t[4]=n[r+3],t[3]=n[r+4],t[2]=n[r+5],t[1]=n[r+6],t[0]=n[r+7],e[0]}n.writeDoubleLE=r?o:u,n.writeDoubleBE=r?u:o,n.readDoubleLE=r?i:a,n.readDoubleBE=r?a:i}():function(){function u(n,e,t,r,o,u){var i=r<0?1:0;if(i&&(r=-r),0===r)n(0,o,u+e),n(1/r>0?0:2147483648,o,u+t);else if(isNaN(r))n(0,o,u+e),n(2146959360,o,u+t);else if(r>1.7976931348623157e308)n(0,o,u+e),n((i<<31|2146435072)>>>0,o,u+t);else{var a;if(r<2.2250738585072014e-308)n((a=r/5e-324)>>>0,o,u+e),n((i<<31|a/4294967296)>>>0,o,u+t);else{var l=Math.floor(Math.log(r)/Math.LN2);1024===l&&(l=1023),n(4503599627370496*(a=r*Math.pow(2,-l))>>>0,o,u+e),n((i<<31|l+1023<<20|1048576*a&1048575)>>>0,o,u+t)}}}function i(n,e,t,r,o){var u=n(r,o+e),i=n(r,o+t),a=2*(i>>31)+1,l=i>>>20&2047,f=4294967296*(1048575&i)+u;return 2047===l?f?NaN:a*(1/0):0===l?5e-324*a*f:a*Math.pow(2,l-1075)*(f+4503599627370496)}n.writeDoubleLE=u.bind(null,e,0,4),n.writeDoubleBE=u.bind(null,t,4,0),n.readDoubleLE=i.bind(null,r,0,4),n.readDoubleBE=i.bind(null,o,4,0)}(),n}function e(n,e,t){e[t]=255&n,e[t+1]=n>>>8&255,e[t+2]=n>>>16&255,e[t+3]=n>>>24}function t(n,e,t){e[t]=n>>>24,e[t+1]=n>>>16&255,e[t+2]=n>>>8&255,e[t+3]=255&n}function r(n,e){return(n[e]|n[e+1]<<8|n[e+2]<<16|n[e+3]<<24)>>>0}function o(n,e){return(n[e]<<24|n[e+1]<<16|n[e+2]<<8|n[e+3])>>>0}module.exports=n(n);
        },{}],"MXG9":[function(require,module,exports) {
            "use strict";function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}module.exports=inquire;
        },{}],"HIDA":[function(require,module,exports) {
            "use strict";var r=exports;r.length=function(r){for(var t=0,n=0,e=0;e<r.length;++e)(n=r.charCodeAt(e))<128?t+=1:n<2048?t+=2:55296==(64512&n)&&56320==(64512&r.charCodeAt(e+1))?(++e,t+=4):t+=3;return t},r.read=function(r,t,n){if(n-t<1)return"";for(var e,o=null,a=[],i=0;t<n;)(e=r[t++])<128?a[i++]=e:e>191&&e<224?a[i++]=(31&e)<<6|63&r[t++]:e>239&&e<365?(e=((7&e)<<18|(63&r[t++])<<12|(63&r[t++])<<6|63&r[t++])-65536,a[i++]=55296+(e>>10),a[i++]=56320+(1023&e)):a[i++]=(15&e)<<12|(63&r[t++])<<6|63&r[t++],i>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,a)),i=0);return o?(i&&o.push(String.fromCharCode.apply(String,a.slice(0,i))),o.join("")):String.fromCharCode.apply(String,a.slice(0,i))},r.write=function(r,t,n){for(var e,o,a=n,i=0;i<r.length;++i)(e=r.charCodeAt(i))<128?t[n++]=e:e<2048?(t[n++]=e>>6|192,t[n++]=63&e|128):55296==(64512&e)&&56320==(64512&(o=r.charCodeAt(i+1)))?(e=65536+((1023&e)<<10)+(1023&o),++i,t[n++]=e>>18|240,t[n++]=e>>12&63|128,t[n++]=e>>6&63|128,t[n++]=63&e|128):(t[n++]=e>>12|224,t[n++]=e>>6&63|128,t[n++]=63&e|128);return n-a};
        },{}],"0yq+":[function(require,module,exports) {
            "use strict";function r(r,n,t){var u=t||8192,e=u>>>1,l=null,c=u;return function(t){if(t<1||t>e)return r(t);c+t>u&&(l=r(u),c=0);var i=n.call(l,c,c+=t);return 7&c&&(c=1+(7|c)),i}}module.exports=r;
        },{}],"mM8D":[function(require,module,exports) {
            "use strict";module.exports=i;var t=require("../util/minimal");function i(t,i){this.lo=t>>>0,this.hi=i>>>0}var o=i.zero=new i(0,0);o.toNumber=function(){return 0},o.zzEncode=o.zzDecode=function(){return this},o.length=function(){return 1};var r=i.zeroHash="\0\0\0\0\0\0\0\0";i.fromNumber=function(t){if(0===t)return o;var r=t<0;r&&(t=-t);var h=t>>>0,n=(t-h)/4294967296>>>0;return r&&(n=~n>>>0,h=~h>>>0,++h>4294967295&&(h=0,++n>4294967295&&(n=0))),new i(h,n)},i.from=function(r){if("number"==typeof r)return i.fromNumber(r);if(t.isString(r)){if(!t.Long)return i.fromNumber(parseInt(r,10));r=t.Long.fromString(r)}return r.low||r.high?new i(r.low>>>0,r.high>>>0):o},i.prototype.toNumber=function(t){if(!t&&this.hi>>>31){var i=1+~this.lo>>>0,o=~this.hi>>>0;return i||(o=o+1>>>0),-(i+4294967296*o)}return this.lo+4294967296*this.hi},i.prototype.toLong=function(i){return t.Long?new t.Long(0|this.lo,0|this.hi,Boolean(i)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(i)}};var h=String.prototype.charCodeAt;i.fromHash=function(t){return t===r?o:new i((h.call(t,0)|h.call(t,1)<<8|h.call(t,2)<<16|h.call(t,3)<<24)>>>0,(h.call(t,4)|h.call(t,5)<<8|h.call(t,6)<<16|h.call(t,7)<<24)>>>0)},i.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},i.prototype.zzEncode=function(){var t=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^t)>>>0,this.lo=(this.lo<<1^t)>>>0,this},i.prototype.zzDecode=function(){var t=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^t)>>>0,this.hi=(this.hi>>>1^t)>>>0,this},i.prototype.length=function(){var t=this.lo,i=(this.lo>>>28|this.hi<<4)>>>0,o=this.hi>>>24;return 0===o?0===i?t<16384?t<128?1:2:t<2097152?3:4:i<16384?i<128?5:6:i<2097152?7:8:o<128?9:10};
        },{"../util/minimal":"+OqZ"}],"FRly":[function(require,module,exports) {
            "use strict";exports.byteLength=u,exports.toByteArray=i,exports.fromByteArray=d;for(var r=[],t=[],e="undefined"!=typeof Uint8Array?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,a=n.length;o<a;++o)r[o]=n[o],t[n.charCodeAt(o)]=o;function h(r){var t=r.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var e=r.indexOf("=");return-1===e&&(e=t),[e,e===t?0:4-e%4]}function u(r){var t=h(r),e=t[0],n=t[1];return 3*(e+n)/4-n}function c(r,t,e){return 3*(t+e)/4-e}function i(r){for(var n,o=h(r),a=o[0],u=o[1],i=new e(c(r,a,u)),f=0,A=u>0?a-4:a,d=0;d<A;d+=4)n=t[r.charCodeAt(d)]<<18|t[r.charCodeAt(d+1)]<<12|t[r.charCodeAt(d+2)]<<6|t[r.charCodeAt(d+3)],i[f++]=n>>16&255,i[f++]=n>>8&255,i[f++]=255&n;return 2===u&&(n=t[r.charCodeAt(d)]<<2|t[r.charCodeAt(d+1)]>>4,i[f++]=255&n),1===u&&(n=t[r.charCodeAt(d)]<<10|t[r.charCodeAt(d+1)]<<4|t[r.charCodeAt(d+2)]>>2,i[f++]=n>>8&255,i[f++]=255&n),i}function f(t){return r[t>>18&63]+r[t>>12&63]+r[t>>6&63]+r[63&t]}function A(r,t,e){for(var n,o=[],a=t;a<e;a+=3)n=(r[a]<<16&16711680)+(r[a+1]<<8&65280)+(255&r[a+2]),o.push(f(n));return o.join("")}function d(t){for(var e,n=t.length,o=n%3,a=[],h=0,u=n-o;h<u;h+=16383)a.push(A(t,h,h+16383>u?u:h+16383));return 1===o?(e=t[n-1],a.push(r[e>>2]+r[e<<4&63]+"==")):2===o&&(e=(t[n-2]<<8)+t[n-1],a.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),a.join("")}t["-".charCodeAt(0)]=62,t["_".charCodeAt(0)]=63;
        },{}],"Quj6":[function(require,module,exports) {
            exports.read=function(a,o,t,r,h){var M,p,w=8*h-r-1,f=(1<<w)-1,e=f>>1,i=-7,N=t?h-1:0,n=t?-1:1,s=a[o+N];for(N+=n,M=s&(1<<-i)-1,s>>=-i,i+=w;i>0;M=256*M+a[o+N],N+=n,i-=8);for(p=M&(1<<-i)-1,M>>=-i,i+=r;i>0;p=256*p+a[o+N],N+=n,i-=8);if(0===M)M=1-e;else{if(M===f)return p?NaN:1/0*(s?-1:1);p+=Math.pow(2,r),M-=e}return(s?-1:1)*p*Math.pow(2,M-r)},exports.write=function(a,o,t,r,h,M){var p,w,f,e=8*M-h-1,i=(1<<e)-1,N=i>>1,n=23===h?Math.pow(2,-24)-Math.pow(2,-77):0,s=r?0:M-1,u=r?1:-1,l=o<0||0===o&&1/o<0?1:0;for(o=Math.abs(o),isNaN(o)||o===1/0?(w=isNaN(o)?1:0,p=i):(p=Math.floor(Math.log(o)/Math.LN2),o*(f=Math.pow(2,-p))<1&&(p--,f*=2),(o+=p+N>=1?n/f:n*Math.pow(2,1-N))*f>=2&&(p++,f/=2),p+N>=i?(w=0,p=i):p+N>=1?(w=(o*f-1)*Math.pow(2,h),p+=N):(w=o*Math.pow(2,N-1)*Math.pow(2,h),p=0));h>=8;a[t+s]=255&w,s+=u,w/=256,h-=8);for(p=p<<h|w,e+=h;e>0;a[t+s]=255&p,s+=u,p/=256,e-=8);a[t+s-u]|=128*l};
        },{}],"aq/z":[function(require,module,exports) {
            var r={}.toString;module.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)};
        },{}],"aMB2":[function(require,module,exports) {

            var global = arguments[3];
            var t=arguments[3],r=require("base64-js"),e=require("ieee754"),n=require("isarray");function i(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(r){return!1}}function o(){return f.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function u(t,r){if(o()<r)throw new RangeError("Invalid typed array length");return f.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r)).__proto__=f.prototype:(null===t&&(t=new f(r)),t.length=r),t}function f(t,r,e){if(!(f.TYPED_ARRAY_SUPPORT||this instanceof f))return new f(t,r,e);if("number"==typeof t){if("string"==typeof r)throw new Error("If encoding is specified then the first argument must be a string");return c(this,t)}return s(this,t,r,e)}function s(t,r,e,n){if("number"==typeof r)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&r instanceof ArrayBuffer?g(t,r,e,n):"string"==typeof r?l(t,r,e):y(t,r)}function h(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function a(t,r,e,n){return h(r),r<=0?u(t,r):void 0!==e?"string"==typeof n?u(t,r).fill(e,n):u(t,r).fill(e):u(t,r)}function c(t,r){if(h(r),t=u(t,r<0?0:0|w(r)),!f.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}function l(t,r,e){if("string"==typeof e&&""!==e||(e="utf8"),!f.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=0|v(r,e),i=(t=u(t,n)).write(r,e);return i!==n&&(t=t.slice(0,i)),t}function p(t,r){var e=r.length<0?0:0|w(r.length);t=u(t,e);for(var n=0;n<e;n+=1)t[n]=255&r[n];return t}function g(t,r,e,n){if(r.byteLength,e<0||r.byteLength<e)throw new RangeError("'offset' is out of bounds");if(r.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");return r=void 0===e&&void 0===n?new Uint8Array(r):void 0===n?new Uint8Array(r,e):new Uint8Array(r,e,n),f.TYPED_ARRAY_SUPPORT?(t=r).__proto__=f.prototype:t=p(t,r),t}function y(t,r){if(f.isBuffer(r)){var e=0|w(r.length);return 0===(t=u(t,e)).length?t:(r.copy(t,0,0,e),t)}if(r){if("undefined"!=typeof ArrayBuffer&&r.buffer instanceof ArrayBuffer||"length"in r)return"number"!=typeof r.length||W(r.length)?u(t,0):p(t,r);if("Buffer"===r.type&&n(r.data))return p(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function w(t){if(t>=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|t}function d(t){return+t!=t&&(t=0),f.alloc(+t)}function v(t,r){if(f.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var e=t.length;if(0===e)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return $(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*e;case"hex":return e>>>1;case"base64":return K(t).length;default:if(n)return $(t).length;r=(""+r).toLowerCase(),n=!0}}function E(t,r,e){var n=!1;if((void 0===r||r<0)&&(r=0),r>this.length)return"";if((void 0===e||e>this.length)&&(e=this.length),e<=0)return"";if((e>>>=0)<=(r>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return x(this,r,e);case"utf8":case"utf-8":return Y(this,r,e);case"ascii":return L(this,r,e);case"latin1":case"binary":return D(this,r,e);case"base64":return S(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function b(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}function R(t,r,e,n,i){if(0===t.length)return-1;if("string"==typeof e?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=i?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(i)return-1;e=t.length-1}else if(e<0){if(!i)return-1;e=0}if("string"==typeof r&&(r=f.from(r,n)),f.isBuffer(r))return 0===r.length?-1:_(t,r,e,n,i);if("number"==typeof r)return r&=255,f.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):_(t,[r],e,n,i);throw new TypeError("val must be string, number or Buffer")}function _(t,r,e,n,i){var o,u=1,f=t.length,s=r.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||r.length<2)return-1;u=2,f/=2,s/=2,e/=2}function h(t,r){return 1===u?t[r]:t.readUInt16BE(r*u)}if(i){var a=-1;for(o=e;o<f;o++)if(h(t,o)===h(r,-1===a?0:o-a)){if(-1===a&&(a=o),o-a+1===s)return a*u}else-1!==a&&(o-=o-a),a=-1}else for(e+s>f&&(e=f-s),o=e;o>=0;o--){for(var c=!0,l=0;l<s;l++)if(h(t,o+l)!==h(r,l)){c=!1;break}if(c)return o}return-1}function A(t,r,e,n){e=Number(e)||0;var i=t.length-e;n?(n=Number(n))>i&&(n=i):n=i;var o=r.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var u=0;u<n;++u){var f=parseInt(r.substr(2*u,2),16);if(isNaN(f))return u;t[e+u]=f}return u}function m(t,r,e,n){return Q($(r,t.length-e),t,e,n)}function P(t,r,e,n){return Q(G(r),t,e,n)}function T(t,r,e,n){return P(t,r,e,n)}function B(t,r,e,n){return Q(K(r),t,e,n)}function U(t,r,e,n){return Q(H(r,t.length-e),t,e,n)}function S(t,e,n){return 0===e&&n===t.length?r.fromByteArray(t):r.fromByteArray(t.slice(e,n))}function Y(t,r,e){e=Math.min(t.length,e);for(var n=[],i=r;i<e;){var o,u,f,s,h=t[i],a=null,c=h>239?4:h>223?3:h>191?2:1;if(i+c<=e)switch(c){case 1:h<128&&(a=h);break;case 2:128==(192&(o=t[i+1]))&&(s=(31&h)<<6|63&o)>127&&(a=s);break;case 3:o=t[i+1],u=t[i+2],128==(192&o)&&128==(192&u)&&(s=(15&h)<<12|(63&o)<<6|63&u)>2047&&(s<55296||s>57343)&&(a=s);break;case 4:o=t[i+1],u=t[i+2],f=t[i+3],128==(192&o)&&128==(192&u)&&128==(192&f)&&(s=(15&h)<<18|(63&o)<<12|(63&u)<<6|63&f)>65535&&s<1114112&&(a=s)}null===a?(a=65533,c=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|1023&a),n.push(a),i+=c}return O(n)}exports.Buffer=f,exports.SlowBuffer=d,exports.INSPECT_MAX_BYTES=50,f.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:i(),exports.kMaxLength=o(),f.poolSize=8192,f._augment=function(t){return t.__proto__=f.prototype,t},f.from=function(t,r,e){return s(null,t,r,e)},f.TYPED_ARRAY_SUPPORT&&(f.prototype.__proto__=Uint8Array.prototype,f.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&f[Symbol.species]===f&&Object.defineProperty(f,Symbol.species,{value:null,configurable:!0})),f.alloc=function(t,r,e){return a(null,t,r,e)},f.allocUnsafe=function(t){return c(null,t)},f.allocUnsafeSlow=function(t){return c(null,t)},f.isBuffer=function(t){return!(null==t||!t._isBuffer)},f.compare=function(t,r){if(!f.isBuffer(t)||!f.isBuffer(r))throw new TypeError("Arguments must be Buffers");if(t===r)return 0;for(var e=t.length,n=r.length,i=0,o=Math.min(e,n);i<o;++i)if(t[i]!==r[i]){e=t[i],n=r[i];break}return e<n?-1:n<e?1:0},f.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},f.concat=function(t,r){if(!n(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return f.alloc(0);var e;if(void 0===r)for(r=0,e=0;e<t.length;++e)r+=t[e].length;var i=f.allocUnsafe(r),o=0;for(e=0;e<t.length;++e){var u=t[e];if(!f.isBuffer(u))throw new TypeError('"list" argument must be an Array of Buffers');u.copy(i,o),o+=u.length}return i},f.byteLength=v,f.prototype._isBuffer=!0,f.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<t;r+=2)b(this,r,r+1);return this},f.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<t;r+=4)b(this,r,r+3),b(this,r+1,r+2);return this},f.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<t;r+=8)b(this,r,r+7),b(this,r+1,r+6),b(this,r+2,r+5),b(this,r+3,r+4);return this},f.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?Y(this,0,t):E.apply(this,arguments)},f.prototype.equals=function(t){if(!f.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===f.compare(this,t)},f.prototype.inspect=function(){var t="",r=exports.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),"<Buffer "+t+">"},f.prototype.compare=function(t,r,e,n,i){if(!f.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===r&&(r=0),void 0===e&&(e=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),r<0||e>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&r>=e)return 0;if(n>=i)return-1;if(r>=e)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),u=(e>>>=0)-(r>>>=0),s=Math.min(o,u),h=this.slice(n,i),a=t.slice(r,e),c=0;c<s;++c)if(h[c]!==a[c]){o=h[c],u=a[c];break}return o<u?-1:u<o?1:0},f.prototype.includes=function(t,r,e){return-1!==this.indexOf(t,r,e)},f.prototype.indexOf=function(t,r,e){return R(this,t,r,e,!0)},f.prototype.lastIndexOf=function(t,r,e){return R(this,t,r,e,!1)},f.prototype.write=function(t,r,e,n){if(void 0===r)n="utf8",e=this.length,r=0;else if(void 0===e&&"string"==typeof r)n=r,e=this.length,r=0;else{if(!isFinite(r))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");r|=0,isFinite(e)?(e|=0,void 0===n&&(n="utf8")):(n=e,e=void 0)}var i=this.length-r;if((void 0===e||e>i)&&(e=i),t.length>0&&(e<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return A(this,t,r,e);case"utf8":case"utf-8":return m(this,t,r,e);case"ascii":return P(this,t,r,e);case"latin1":case"binary":return T(this,t,r,e);case"base64":return B(this,t,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U(this,t,r,e);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var I=4096;function O(t){var r=t.length;if(r<=I)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=I));return e}function L(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(127&t[i]);return n}function D(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(t[i]);return n}function x(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var i="",o=r;o<e;++o)i+=Z(t[o]);return i}function C(t,r,e){for(var n=t.slice(r,e),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function M(t,r,e){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}function k(t,r,e,n,i,o){if(!f.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>i||r<o)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}function N(t,r,e,n){r<0&&(r=65535+r+1);for(var i=0,o=Math.min(t.length-e,2);i<o;++i)t[e+i]=(r&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function z(t,r,e,n){r<0&&(r=4294967295+r+1);for(var i=0,o=Math.min(t.length-e,4);i<o;++i)t[e+i]=r>>>8*(n?i:3-i)&255}function F(t,r,e,n,i,o){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function j(t,r,n,i,o){return o||F(t,r,n,4,3.4028234663852886e38,-3.4028234663852886e38),e.write(t,r,n,i,23,4),n+4}function q(t,r,n,i,o){return o||F(t,r,n,8,1.7976931348623157e308,-1.7976931348623157e308),e.write(t,r,n,i,52,8),n+8}f.prototype.slice=function(t,r){var e,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(r=void 0===r?n:~~r)<0?(r+=n)<0&&(r=0):r>n&&(r=n),r<t&&(r=t),f.TYPED_ARRAY_SUPPORT)(e=this.subarray(t,r)).__proto__=f.prototype;else{var i=r-t;e=new f(i,void 0);for(var o=0;o<i;++o)e[o]=this[o+t]}return e},f.prototype.readUIntLE=function(t,r,e){t|=0,r|=0,e||M(t,r,this.length);for(var n=this[t],i=1,o=0;++o<r&&(i*=256);)n+=this[t+o]*i;return n},f.prototype.readUIntBE=function(t,r,e){t|=0,r|=0,e||M(t,r,this.length);for(var n=this[t+--r],i=1;r>0&&(i*=256);)n+=this[t+--r]*i;return n},f.prototype.readUInt8=function(t,r){return r||M(t,1,this.length),this[t]},f.prototype.readUInt16LE=function(t,r){return r||M(t,2,this.length),this[t]|this[t+1]<<8},f.prototype.readUInt16BE=function(t,r){return r||M(t,2,this.length),this[t]<<8|this[t+1]},f.prototype.readUInt32LE=function(t,r){return r||M(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},f.prototype.readUInt32BE=function(t,r){return r||M(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},f.prototype.readIntLE=function(t,r,e){t|=0,r|=0,e||M(t,r,this.length);for(var n=this[t],i=1,o=0;++o<r&&(i*=256);)n+=this[t+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*r)),n},f.prototype.readIntBE=function(t,r,e){t|=0,r|=0,e||M(t,r,this.length);for(var n=r,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*r)),o},f.prototype.readInt8=function(t,r){return r||M(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},f.prototype.readInt16LE=function(t,r){r||M(t,2,this.length);var e=this[t]|this[t+1]<<8;return 32768&e?4294901760|e:e},f.prototype.readInt16BE=function(t,r){r||M(t,2,this.length);var e=this[t+1]|this[t]<<8;return 32768&e?4294901760|e:e},f.prototype.readInt32LE=function(t,r){return r||M(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},f.prototype.readInt32BE=function(t,r){return r||M(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},f.prototype.readFloatLE=function(t,r){return r||M(t,4,this.length),e.read(this,t,!0,23,4)},f.prototype.readFloatBE=function(t,r){return r||M(t,4,this.length),e.read(this,t,!1,23,4)},f.prototype.readDoubleLE=function(t,r){return r||M(t,8,this.length),e.read(this,t,!0,52,8)},f.prototype.readDoubleBE=function(t,r){return r||M(t,8,this.length),e.read(this,t,!1,52,8)},f.prototype.writeUIntLE=function(t,r,e,n){(t=+t,r|=0,e|=0,n)||k(this,t,r,e,Math.pow(2,8*e)-1,0);var i=1,o=0;for(this[r]=255&t;++o<e&&(i*=256);)this[r+o]=t/i&255;return r+e},f.prototype.writeUIntBE=function(t,r,e,n){(t=+t,r|=0,e|=0,n)||k(this,t,r,e,Math.pow(2,8*e)-1,0);var i=e-1,o=1;for(this[r+i]=255&t;--i>=0&&(o*=256);)this[r+i]=t/o&255;return r+e},f.prototype.writeUInt8=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,1,255,0),f.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[r]=255&t,r+1},f.prototype.writeUInt16LE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):N(this,t,r,!0),r+2},f.prototype.writeUInt16BE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):N(this,t,r,!1),r+2},f.prototype.writeUInt32LE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=255&t):z(this,t,r,!0),r+4},f.prototype.writeUInt32BE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):z(this,t,r,!1),r+4},f.prototype.writeIntLE=function(t,r,e,n){if(t=+t,r|=0,!n){var i=Math.pow(2,8*e-1);k(this,t,r,e,i-1,-i)}var o=0,u=1,f=0;for(this[r]=255&t;++o<e&&(u*=256);)t<0&&0===f&&0!==this[r+o-1]&&(f=1),this[r+o]=(t/u>>0)-f&255;return r+e},f.prototype.writeIntBE=function(t,r,e,n){if(t=+t,r|=0,!n){var i=Math.pow(2,8*e-1);k(this,t,r,e,i-1,-i)}var o=e-1,u=1,f=0;for(this[r+o]=255&t;--o>=0&&(u*=256);)t<0&&0===f&&0!==this[r+o+1]&&(f=1),this[r+o]=(t/u>>0)-f&255;return r+e},f.prototype.writeInt8=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,1,127,-128),f.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[r]=255&t,r+1},f.prototype.writeInt16LE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):N(this,t,r,!0),r+2},f.prototype.writeInt16BE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):N(this,t,r,!1),r+2},f.prototype.writeInt32LE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,4,2147483647,-2147483648),f.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24):z(this,t,r,!0),r+4},f.prototype.writeInt32BE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),f.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):z(this,t,r,!1),r+4},f.prototype.writeFloatLE=function(t,r,e){return j(this,t,r,!0,e)},f.prototype.writeFloatBE=function(t,r,e){return j(this,t,r,!1,e)},f.prototype.writeDoubleLE=function(t,r,e){return q(this,t,r,!0,e)},f.prototype.writeDoubleBE=function(t,r,e){return q(this,t,r,!1,e)},f.prototype.copy=function(t,r,e,n){if(e||(e=0),n||0===n||(n=this.length),r>=t.length&&(r=t.length),r||(r=0),n>0&&n<e&&(n=e),n===e)return 0;if(0===t.length||0===this.length)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(e<0||e>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-r<n-e&&(n=t.length-r+e);var i,o=n-e;if(this===t&&e<r&&r<n)for(i=o-1;i>=0;--i)t[i+r]=this[i+e];else if(o<1e3||!f.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)t[i+r]=this[i+e];else Uint8Array.prototype.set.call(t,this.subarray(e,e+o),r);return o},f.prototype.fill=function(t,r,e,n){if("string"==typeof t){if("string"==typeof r?(n=r,r=0,e=this.length):"string"==typeof e&&(n=e,e=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!f.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(r<0||this.length<r||this.length<e)throw new RangeError("Out of range index");if(e<=r)return this;var o;if(r>>>=0,e=void 0===e?this.length:e>>>0,t||(t=0),"number"==typeof t)for(o=r;o<e;++o)this[o]=t;else{var u=f.isBuffer(t)?t:$(new f(t,n).toString()),s=u.length;for(o=0;o<e-r;++o)this[o+r]=u[o%s]}return this};var V=/[^+\/0-9A-Za-z-_]/g;function X(t){if((t=J(t).replace(V,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}function J(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function Z(t){return t<16?"0"+t.toString(16):t.toString(16)}function $(t,r){var e;r=r||1/0;for(var n=t.length,i=null,o=[],u=0;u<n;++u){if((e=t.charCodeAt(u))>55295&&e<57344){if(!i){if(e>56319){(r-=3)>-1&&o.push(239,191,189);continue}if(u+1===n){(r-=3)>-1&&o.push(239,191,189);continue}i=e;continue}if(e<56320){(r-=3)>-1&&o.push(239,191,189),i=e;continue}e=65536+(i-55296<<10|e-56320)}else i&&(r-=3)>-1&&o.push(239,191,189);if(i=null,e<128){if((r-=1)<0)break;o.push(e)}else if(e<2048){if((r-=2)<0)break;o.push(e>>6|192,63&e|128)}else if(e<65536){if((r-=3)<0)break;o.push(e>>12|224,e>>6&63|128,63&e|128)}else{if(!(e<1114112))throw new Error("Invalid code point");if((r-=4)<0)break;o.push(e>>18|240,e>>12&63|128,e>>6&63|128,63&e|128)}}return o}function G(t){for(var r=[],e=0;e<t.length;++e)r.push(255&t.charCodeAt(e));return r}function H(t,r){for(var e,n,i,o=[],u=0;u<t.length&&!((r-=2)<0);++u)n=(e=t.charCodeAt(u))>>8,i=e%256,o.push(i),o.push(n);return o}function K(t){return r.toByteArray(X(t))}function Q(t,r,e,n){for(var i=0;i<n&&!(i+e>=r.length||i>=t.length);++i)r[i+e]=t[i];return i}function W(t){return t!=t}
        },{"base64-js":"FRly","ieee754":"Quj6","isarray":"aq/z","buffer":"aMB2"}],"+OqZ":[function(require,module,exports) {
            var global = arguments[3];
            var Buffer = require("buffer").Buffer;
            var e=arguments[3],r=require("buffer").Buffer,t=exports;function n(e,r,t){for(var n=Object.keys(r),o=0;o<n.length;++o)void 0!==e[n[o]]&&t||(e[n[o]]=r[n[o]]);return e}function o(e){function r(e,t){if(!(this instanceof r))return new r(e,t);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,r):Object.defineProperty(this,"stack",{value:(new Error).stack||""}),t&&n(this,t)}return(r.prototype=Object.create(Error.prototype)).constructor=r,Object.defineProperty(r.prototype,"name",{get:function(){return e}}),r.prototype.toString=function(){return this.name+": "+this.message},r}t.asPromise=require("@protobufjs/aspromise"),t.base64=require("@protobufjs/base64"),t.EventEmitter=require("@protobufjs/eventemitter"),t.float=require("@protobufjs/float"),t.inquire=require("@protobufjs/inquire"),t.utf8=require("@protobufjs/utf8"),t.pool=require("@protobufjs/pool"),t.LongBits=require("./longbits"),t.global="undefined"!=typeof window&&window||void 0!==e&&e||"undefined"!=typeof self&&self||this,t.emptyArray=Object.freeze?Object.freeze([]):[],t.emptyObject=Object.freeze?Object.freeze({}):{},t.isNode=Boolean(t.global.process&&t.global.process.versions&&t.global.process.versions.node),t.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},t.isString=function(e){return"string"==typeof e||e instanceof String},t.isObject=function(e){return e&&"object"==typeof e},t.isset=t.isSet=function(e,r){var t=e[r];return!(null==t||!e.hasOwnProperty(r))&&("object"!=typeof t||(Array.isArray(t)?t.length:Object.keys(t).length)>0)},t.Buffer=function(){try{var e=t.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(r){return null}}(),t._Buffer_from=null,t._Buffer_allocUnsafe=null,t.newBuffer=function(e){return"number"==typeof e?t.Buffer?t._Buffer_allocUnsafe(e):new t.Array(e):t.Buffer?t._Buffer_from(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},t.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,t.Long=t.global.dcodeIO&&t.global.dcodeIO.Long||t.global.Long||t.inquire("long"),t.key2Re=/^true|false|0|1$/,t.key32Re=/^-?(?:0|[1-9][0-9]*)$/,t.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,t.longToHash=function(e){return e?t.LongBits.from(e).toHash():t.LongBits.zeroHash},t.longFromHash=function(e,r){var n=t.LongBits.fromHash(e);return t.Long?t.Long.fromBits(n.lo,n.hi,r):n.toNumber(Boolean(r))},t.merge=n,t.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},t.newError=o,t.ProtocolError=o("ProtocolError"),t.oneOfGetter=function(e){for(var r={},t=0;t<e.length;++t)r[e[t]]=1;return function(){for(var e=Object.keys(this),t=e.length-1;t>-1;--t)if(1===r[e[t]]&&void 0!==this[e[t]]&&null!==this[e[t]])return e[t]}},t.oneOfSetter=function(e){return function(r){for(var t=0;t<e.length;++t)e[t]!==r&&delete this[e[t]]}},t.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},t._configure=function(){var e=t.Buffer;e?(t._Buffer_from=e.from!==Uint8Array.from&&e.from||function(r,t){return new e(r,t)},t._Buffer_allocUnsafe=e.allocUnsafe||function(r){return new e(r)}):t._Buffer_from=t._Buffer_allocUnsafe=null};
        },{"@protobufjs/aspromise":"5Ezc","@protobufjs/base64":"20Fs","@protobufjs/eventemitter":"JI1+","@protobufjs/float":"M11I","@protobufjs/inquire":"MXG9","@protobufjs/utf8":"HIDA","@protobufjs/pool":"0yq+","./longbits":"mM8D","buffer":"aMB2"}],"uteQ":[function(require,module,exports) {
            "use strict";module.exports=u;var t,i=require("./util/minimal"),n=i.LongBits,e=i.base64,o=i.utf8;function r(t,i,n){this.fn=t,this.len=i,this.next=void 0,this.val=n}function s(){}function h(t){this.head=t.head,this.tail=t.tail,this.len=t.len,this.next=t.states}function u(){this.len=0,this.head=new r(s,0,0),this.tail=this.head,this.states=null}function l(t,i,n){i[n]=255&t}function p(t,i,n){for(;t>127;)i[n++]=127&t|128,t>>>=7;i[n]=t}function a(t,i){this.len=t,this.next=void 0,this.val=i}function f(t,i,n){for(;t.hi;)i[n++]=127&t.lo|128,t.lo=(t.lo>>>7|t.hi<<25)>>>0,t.hi>>>=7;for(;t.lo>127;)i[n++]=127&t.lo|128,t.lo=t.lo>>>7;i[n++]=t.lo}function c(t,i,n){i[n]=255&t,i[n+1]=t>>>8&255,i[n+2]=t>>>16&255,i[n+3]=t>>>24}u.create=i.Buffer?function(){return(u.create=function(){return new t})()}:function(){return new u},u.alloc=function(t){return new i.Array(t)},i.Array!==Array&&(u.alloc=i.pool(u.alloc,i.Array.prototype.subarray)),u.prototype._push=function(t,i,n){return this.tail=this.tail.next=new r(t,i,n),this.len+=i,this},a.prototype=Object.create(r.prototype),a.prototype.fn=p,u.prototype.uint32=function(t){return this.len+=(this.tail=this.tail.next=new a((t>>>=0)<128?1:t<16384?2:t<2097152?3:t<268435456?4:5,t)).len,this},u.prototype.int32=function(t){return t<0?this._push(f,10,n.fromNumber(t)):this.uint32(t)},u.prototype.sint32=function(t){return this.uint32((t<<1^t>>31)>>>0)},u.prototype.uint64=function(t){var i=n.from(t);return this._push(f,i.length(),i)},u.prototype.int64=u.prototype.uint64,u.prototype.sint64=function(t){var i=n.from(t).zzEncode();return this._push(f,i.length(),i)},u.prototype.bool=function(t){return this._push(l,1,t?1:0)},u.prototype.fixed32=function(t){return this._push(c,4,t>>>0)},u.prototype.sfixed32=u.prototype.fixed32,u.prototype.fixed64=function(t){var i=n.from(t);return this._push(c,4,i.lo)._push(c,4,i.hi)},u.prototype.sfixed64=u.prototype.fixed64,u.prototype.float=function(t){return this._push(i.float.writeFloatLE,4,t)},u.prototype.double=function(t){return this._push(i.float.writeDoubleLE,8,t)};var y=i.Array.prototype.set?function(t,i,n){i.set(t,n)}:function(t,i,n){for(var e=0;e<t.length;++e)i[n+e]=t[e]};u.prototype.bytes=function(t){var n=t.length>>>0;if(!n)return this._push(l,1,0);if(i.isString(t)){var o=u.alloc(n=e.length(t));e.decode(t,o,0),t=o}return this.uint32(n)._push(y,n,t)},u.prototype.string=function(t){var i=o.length(t);return i?this.uint32(i)._push(o.write,i,t):this._push(l,1,0)},u.prototype.fork=function(){return this.states=new h(this),this.head=this.tail=new r(s,0,0),this.len=0,this},u.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new r(s,0,0),this.len=0),this},u.prototype.ldelim=function(){var t=this.head,i=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=t.next,this.tail=i,this.len+=n),this},u.prototype.finish=function(){for(var t=this.head.next,i=this.constructor.alloc(this.len),n=0;t;)t.fn(t.val,i,n),n+=t.len,t=t.next;return i},u._configure=function(i){t=i};
        },{"./util/minimal":"+OqZ"}],"CkBE":[function(require,module,exports) {

            "use strict";module.exports=n;var t=require("./writer");(n.prototype=Object.create(t.prototype)).constructor=n;var e=require("./util/minimal"),r=e.Buffer;function n(){t.call(this)}n.alloc=function(t){return(n.alloc=e._Buffer_allocUnsafe)(t)};var i=r&&r.prototype instanceof Uint8Array&&"set"===r.prototype.set.name?function(t,e,r){e.set(t,r)}:function(t,e,r){if(t.copy)t.copy(e,r,0,t.length);else for(var n=0;n<t.length;)e[r++]=t[n++]};function o(t,r,n){t.length<40?e.utf8.write(t,r,n):r.utf8Write(t,n)}n.prototype.bytes=function(t){e.isString(t)&&(t=e._Buffer_from(t,"base64"));var r=t.length>>>0;return this.uint32(r),r&&this._push(i,r,t),this},n.prototype.string=function(t){var e=r.byteLength(t);return this.uint32(e),e&&this._push(o,e,t),this};
        },{"./writer":"uteQ","./util/minimal":"+OqZ"}],"nX4I":[function(require,module,exports) {
            "use strict";module.exports=h;var t,i=require("./util/minimal"),s=i.LongBits,r=i.utf8;function o(t,i){return RangeError("index out of range: "+t.pos+" + "+(i||1)+" > "+t.len)}function h(t){this.buf=t,this.pos=0,this.len=t.length}var n="undefined"!=typeof Uint8Array?function(t){if(t instanceof Uint8Array||Array.isArray(t))return new h(t);throw Error("illegal buffer")}:function(t){if(Array.isArray(t))return new h(t);throw Error("illegal buffer")};function e(){var t=new s(0,0),i=0;if(!(this.len-this.pos>4)){for(;i<3;++i){if(this.pos>=this.len)throw o(this);if(t.lo=(t.lo|(127&this.buf[this.pos])<<7*i)>>>0,this.buf[this.pos++]<128)return t}return t.lo=(t.lo|(127&this.buf[this.pos++])<<7*i)>>>0,t}for(;i<4;++i)if(t.lo=(t.lo|(127&this.buf[this.pos])<<7*i)>>>0,this.buf[this.pos++]<128)return t;if(t.lo=(t.lo|(127&this.buf[this.pos])<<28)>>>0,t.hi=(t.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return t;if(i=0,this.len-this.pos>4){for(;i<5;++i)if(t.hi=(t.hi|(127&this.buf[this.pos])<<7*i+3)>>>0,this.buf[this.pos++]<128)return t}else for(;i<5;++i){if(this.pos>=this.len)throw o(this);if(t.hi=(t.hi|(127&this.buf[this.pos])<<7*i+3)>>>0,this.buf[this.pos++]<128)return t}throw Error("invalid varint encoding")}function u(t,i){return(t[i-4]|t[i-3]<<8|t[i-2]<<16|t[i-1]<<24)>>>0}function f(){if(this.pos+8>this.len)throw o(this,8);return new s(u(this.buf,this.pos+=4),u(this.buf,this.pos+=4))}h.create=i.Buffer?function(s){return(h.create=function(s){return i.Buffer.isBuffer(s)?new t(s):n(s)})(s)}:n,h.prototype._slice=i.Array.prototype.subarray||i.Array.prototype.slice,h.prototype.uint32=function(){var t=4294967295;return function(){if(t=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return t;if(t=(t|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return t;if(t=(t|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return t;if(t=(t|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return t;if(t=(t|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return t;if((this.pos+=5)>this.len)throw this.pos=this.len,o(this,10);return t}}(),h.prototype.int32=function(){return 0|this.uint32()},h.prototype.sint32=function(){var t=this.uint32();return t>>>1^-(1&t)|0},h.prototype.bool=function(){return 0!==this.uint32()},h.prototype.fixed32=function(){if(this.pos+4>this.len)throw o(this,4);return u(this.buf,this.pos+=4)},h.prototype.sfixed32=function(){if(this.pos+4>this.len)throw o(this,4);return 0|u(this.buf,this.pos+=4)},h.prototype.float=function(){if(this.pos+4>this.len)throw o(this,4);var t=i.float.readFloatLE(this.buf,this.pos);return this.pos+=4,t},h.prototype.double=function(){if(this.pos+8>this.len)throw o(this,4);var t=i.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,t},h.prototype.bytes=function(){var t=this.uint32(),i=this.pos,s=this.pos+t;if(s>this.len)throw o(this,t);return this.pos+=t,Array.isArray(this.buf)?this.buf.slice(i,s):i===s?new this.buf.constructor(0):this._slice.call(this.buf,i,s)},h.prototype.string=function(){var t=this.bytes();return r.read(t,0,t.length)},h.prototype.skip=function(t){if("number"==typeof t){if(this.pos+t>this.len)throw o(this,t);this.pos+=t}else do{if(this.pos>=this.len)throw o(this)}while(128&this.buf[this.pos++]);return this},h.prototype.skipType=function(t){switch(t){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(t=7&this.uint32());)this.skipType(t);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+t+" at offset "+this.pos)}return this},h._configure=function(s){t=s;var r=i.Long?"toLong":"toNumber";i.merge(h.prototype,{int64:function(){return e.call(this)[r](!1)},uint64:function(){return e.call(this)[r](!0)},sint64:function(){return e.call(this).zzDecode()[r](!1)},fixed64:function(){return f.call(this)[r](!0)},sfixed64:function(){return f.call(this)[r](!1)}})};
        },{"./util/minimal":"+OqZ"}],"4pJQ":[function(require,module,exports) {
            "use strict";module.exports=r;var t=require("./reader");(r.prototype=Object.create(t.prototype)).constructor=r;var e=require("./util/minimal");function r(e){t.call(this,e)}e.Buffer&&(r.prototype._slice=e.Buffer.prototype.slice),r.prototype.string=function(){var t=this.uint32();return this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+t,this.len))};
        },{"./reader":"nX4I","./util/minimal":"+OqZ"}],"uviC":[function(require,module,exports) {
            "use strict";module.exports=t;var e=require("../util/minimal");function t(t,r,i){if("function"!=typeof t)throw TypeError("rpcImpl must be a function");e.EventEmitter.call(this),this.rpcImpl=t,this.requestDelimited=Boolean(r),this.responseDelimited=Boolean(i)}(t.prototype=Object.create(e.EventEmitter.prototype)).constructor=t,t.prototype.rpcCall=function t(r,i,n,o,l){if(!o)throw TypeError("request must be specified");var u=this;if(!l)return e.asPromise(t,u,r,i,n,o);if(u.rpcImpl)try{return u.rpcImpl(r,i[u.requestDelimited?"encodeDelimited":"encode"](o).finish(),function(e,t){if(e)return u.emit("error",e,r),l(e);if(null!==t){if(!(t instanceof n))try{t=n[u.responseDelimited?"decodeDelimited":"decode"](t)}catch(e){return u.emit("error",e,r),l(e)}return u.emit("data",t,r),l(null,t)}u.end(!0)})}catch(c){return u.emit("error",c,r),void setTimeout(function(){l(c)},0)}else setTimeout(function(){l(Error("already ended"))},0)},t.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this};
        },{"../util/minimal":"+OqZ"}],"j3cJ":[function(require,module,exports) {
            "use strict";var e=exports;e.Service=require("./rpc/service");
        },{"./rpc/service":"uviC"}],"S/PD":[function(require,module,exports) {
            "use strict";module.exports={};
        },{}],"6BiI":[function(require,module,exports) {
            "use strict";var r=exports;function e(){r.Reader._configure(r.BufferReader),r.util._configure()}r.build="minimal",r.Writer=require("./writer"),r.BufferWriter=require("./writer_buffer"),r.Reader=require("./reader"),r.BufferReader=require("./reader_buffer"),r.util=require("./util/minimal"),r.rpc=require("./rpc"),r.roots=require("./roots"),r.configure=e,r.Writer._configure(r.BufferWriter),e();
        },{"./writer":"uteQ","./writer_buffer":"CkBE","./reader":"nX4I","./reader_buffer":"4pJQ","./util/minimal":"+OqZ","./rpc":"j3cJ","./roots":"S/PD"}],"YmP9":[function(require,module,exports) {
            "use strict";function r(n,e){"string"==typeof n&&(e=n,n=void 0);var t=[];function o(n){if("string"!=typeof n){var e=i();if(r.verbose&&console.log("codegen: "+e),e="return "+e,n){for(var u=Object.keys(n),a=new Array(u.length+1),c=new Array(u.length),s=0;s<u.length;)a[s]=u[s],c[s]=n[u[s++]];return a[s]=e,Function.apply(null,a).apply(null,c)}return Function(e)()}for(var l=new Array(arguments.length-1),f=0;f<l.length;)l[f]=arguments[++f];if(f=0,n=n.replace(/%([%dfijs])/g,function(r,n){var e=l[f++];switch(n){case"d":case"f":return String(Number(e));case"i":return String(Math.floor(e));case"j":return JSON.stringify(e);case"s":return String(e)}return"%"}),f!==l.length)throw Error("parameter count mismatch");return t.push(n),o}function i(r){return"function "+(r||e||"")+"("+(n&&n.join(",")||"")+"){\n  "+t.join("\n  ")+"\n}"}return o.toString=i,o}module.exports=r,r.verbose=!1;
        },{}],"h5wE":[function(require,module,exports) {
            "use strict";module.exports=n;var e=require("@protobufjs/aspromise"),r=require("@protobufjs/inquire"),t=r("fs");function n(r,s,i){return"function"==typeof s?(i=s,s={}):s||(s={}),i?!s.xhr&&t&&t.readFile?t.readFile(r,function(e,t){return e&&"undefined"!=typeof XMLHttpRequest?n.xhr(r,s,i):e?i(e):i(null,s.binary?t:t.toString("utf8"))}):n.xhr(r,s,i):e(n,this,r,s)}n.xhr=function(e,r,t){var n=new XMLHttpRequest;n.onreadystatechange=function(){if(4===n.readyState){if(0!==n.status&&200!==n.status)return t(Error("status "+n.status));if(r.binary){var e=n.response;if(!e){e=[];for(var s=0;s<n.responseText.length;++s)e.push(255&n.responseText.charCodeAt(s))}return t(null,"undefined"!=typeof Uint8Array?new Uint8Array(e):e)}return t(null,n.responseText)}},r.binary&&("overrideMimeType"in n&&n.overrideMimeType("text/plain; charset=x-user-defined"),n.responseType="arraybuffer"),n.open("GET",e),n.send()};
        },{"@protobufjs/aspromise":"5Ezc","@protobufjs/inquire":"MXG9"}],"Mao7":[function(require,module,exports) {
            "use strict";var e=exports,r=e.isAbsolute=function(e){return/^(?:\/|\w+:)/.test(e)},t=e.normalize=function(e){var t=(e=e.replace(/\\/g,"/").replace(/\/{2,}/g,"/")).split("/"),n=r(e),i="";n&&(i=t.shift()+"/");for(var l=0;l<t.length;)".."===t[l]?l>0&&".."!==t[l-1]?t.splice(--l,2):n?t.splice(l,1):++l:"."===t[l]?t.splice(l,1):++l;return i+t.join("/")};e.resolve=function(e,n,i){return i||(n=t(n)),r(n)?n:(i||(e=t(e)),(e=e.replace(/(?:\/|^)[^\/]+$/,"")).length?t(e+"/"+n):n)};
        },{}],"eiCH":[function(require,module,exports) {
            "use strict";var t=exports,e=require("./util"),i=["double","float","int32","uint32","sint32","fixed32","sfixed32","int64","uint64","sint64","fixed64","sfixed64","bool","string","bytes"];function n(t,e){var n=0,r={};for(e|=0;n<t.length;)r[i[n+e]]=t[n++];return r}t.basic=n([1,5,0,0,0,5,5,0,0,0,1,1,0,2,2]),t.defaults=n([0,0,0,0,0,0,0,0,0,0,0,0,!1,"",e.emptyArray,null]),t.long=n([0,0,0,1,1],7),t.mapKey=n([0,0,0,5,5,0,0,0,1,1,0,2],2),t.packed=n([1,5,0,0,0,5,5,0,0,0,1,1,0]);
        },{"./util":"CVja"}],"+iVu":[function(require,module,exports) {
            "use strict";module.exports=n;var t=require("./object");((n.prototype=Object.create(t.prototype)).constructor=n).className="Field";var e,i=require("./enum"),s=require("./types"),o=require("./util"),r=/^required|optional|repeated$/;function n(e,i,n,p,l,u,a){if(o.isObject(p)?(a=l,u=p,p=l=void 0):o.isObject(l)&&(a=u,u=l,l=void 0),t.call(this,e,u),!o.isInteger(i)||i<0)throw TypeError("id must be a non-negative integer");if(!o.isString(n))throw TypeError("type must be a string");if(void 0!==p&&!r.test(p=p.toString().toLowerCase()))throw TypeError("rule must be a string rule");if(void 0!==l&&!o.isString(l))throw TypeError("extend must be a string");this.rule=p&&"optional"!==p?p:void 0,this.type=n,this.id=i,this.extend=l||void 0,this.required="required"===p,this.optional=!this.required,this.repeated="repeated"===p,this.map=!1,this.message=null,this.partOf=null,this.typeDefault=null,this.defaultValue=null,this.long=!!o.Long&&void 0!==s.long[n],this.bytes="bytes"===n,this.resolvedType=null,this.extensionField=null,this.declaringField=null,this._packed=null,this.comment=a}n.fromJSON=function(t,e){return new n(t,e.id,e.type,e.rule,e.extend,e.options,e.comment)},Object.defineProperty(n.prototype,"packed",{get:function(){return null===this._packed&&(this._packed=!1!==this.getOption("packed")),this._packed}}),n.prototype.setOption=function(e,i,s){return"packed"===e&&(this._packed=null),t.prototype.setOption.call(this,e,i,s)},n.prototype.toJSON=function(t){var e=!!t&&Boolean(t.keepComments);return o.toObject(["rule","optional"!==this.rule&&this.rule||void 0,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",e?this.comment:void 0])},n.prototype.resolve=function(){if(this.resolved)return this;if(void 0===(this.typeDefault=s.defaults[this.type])&&(this.resolvedType=(this.declaringField?this.declaringField.parent:this.parent).lookupTypeOrEnum(this.type),this.resolvedType instanceof e?this.typeDefault=null:this.typeDefault=this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]),this.options&&null!=this.options.default&&(this.typeDefault=this.options.default,this.resolvedType instanceof i&&"string"==typeof this.typeDefault&&(this.typeDefault=this.resolvedType.values[this.typeDefault])),this.options&&(!0!==this.options.packed&&(void 0===this.options.packed||!this.resolvedType||this.resolvedType instanceof i)||delete this.options.packed,Object.keys(this.options).length||(this.options=void 0)),this.long)this.typeDefault=o.Long.fromNumber(this.typeDefault,"u"===this.type.charAt(0)),Object.freeze&&Object.freeze(this.typeDefault);else if(this.bytes&&"string"==typeof this.typeDefault){var r;o.base64.test(this.typeDefault)?o.base64.decode(this.typeDefault,r=o.newBuffer(o.base64.length(this.typeDefault)),0):o.utf8.write(this.typeDefault,r=o.newBuffer(o.utf8.length(this.typeDefault)),0),this.typeDefault=r}return this.map?this.defaultValue=o.emptyObject:this.repeated?this.defaultValue=o.emptyArray:this.defaultValue=this.typeDefault,this.parent instanceof e&&(this.parent.ctor.prototype[this.name]=this.defaultValue),t.prototype.resolve.call(this)},n.d=function(t,e,i,s){return"function"==typeof e?e=o.decorateType(e).name:e&&"object"==typeof e&&(e=o.decorateEnum(e).name),function(r,p){o.decorateType(r.constructor).add(new n(p,t,e,i,{default:s}))}},n._configure=function(t){e=t};
        },{"./object":"lIB1","./enum":"QVBM","./types":"eiCH","./util":"CVja"}],"Iv+k":[function(require,module,exports) {
            "use strict";module.exports=f;var t=require("./object");((f.prototype=Object.create(t.prototype)).constructor=f).className="Namespace";var e,r,n,o=require("./field"),i=require("./util");function s(t,e){if(t&&t.length){for(var r={},n=0;n<t.length;++n)r[t[n].name]=t[n].toJSON(e);return r}}function f(e,r){t.call(this,e,r),this.nested=void 0,this._nestedArray=null}function u(t){return t._nestedArray=null,t}f.fromJSON=function(t,e){return new f(t,e.options).addJSON(e.nested)},f.arrayToJSON=s,f.isReservedId=function(t,e){if(t)for(var r=0;r<t.length;++r)if("string"!=typeof t[r]&&t[r][0]<=e&&t[r][1]>=e)return!0;return!1},f.isReservedName=function(t,e){if(t)for(var r=0;r<t.length;++r)if(t[r]===e)return!0;return!1},Object.defineProperty(f.prototype,"nestedArray",{get:function(){return this._nestedArray||(this._nestedArray=i.toArray(this.nested))}}),f.prototype.toJSON=function(t){return i.toObject(["options",this.options,"nested",s(this.nestedArray,t)])},f.prototype.addJSON=function(t){if(t)for(var i,s=Object.keys(t),u=0;u<s.length;++u)i=t[s[u]],this.add((void 0!==i.fields?e.fromJSON:void 0!==i.values?n.fromJSON:void 0!==i.methods?r.fromJSON:void 0!==i.id?o.fromJSON:f.fromJSON)(s[u],i));return this},f.prototype.get=function(t){return this.nested&&this.nested[t]||null},f.prototype.getEnum=function(t){if(this.nested&&this.nested[t]instanceof n)return this.nested[t].values;throw Error("no such enum: "+t)},f.prototype.add=function(t){if(!(t instanceof o&&void 0!==t.extend||t instanceof e||t instanceof n||t instanceof r||t instanceof f))throw TypeError("object must be a valid nested object");if(this.nested){var i=this.get(t.name);if(i){if(!(i instanceof f&&t instanceof f)||i instanceof e||i instanceof r)throw Error("duplicate name '"+t.name+"' in "+this);for(var s=i.nestedArray,a=0;a<s.length;++a)t.add(s[a]);this.remove(i),this.nested||(this.nested={}),t.setOptions(i.options,!0)}}else this.nested={};return this.nested[t.name]=t,t.onAdd(this),u(this)},f.prototype.remove=function(e){if(!(e instanceof t))throw TypeError("object must be a ReflectionObject");if(e.parent!==this)throw Error(e+" is not a member of "+this);return delete this.nested[e.name],Object.keys(this.nested).length||(this.nested=void 0),e.onRemove(this),u(this)},f.prototype.define=function(t,e){if(i.isString(t))t=t.split(".");else if(!Array.isArray(t))throw TypeError("illegal path");if(t&&t.length&&""===t[0])throw Error("path must be relative");for(var r=this;t.length>0;){var n=t.shift();if(r.nested&&r.nested[n]){if(!((r=r.nested[n])instanceof f))throw Error("path conflicts with non-namespace objects")}else r.add(r=new f(n))}return e&&r.addJSON(e),r},f.prototype.resolveAll=function(){for(var t=this.nestedArray,e=0;e<t.length;)t[e]instanceof f?t[e++].resolveAll():t[e++].resolve();return this.resolve()},f.prototype.lookup=function(t,e,r){if("boolean"==typeof e?(r=e,e=void 0):e&&!Array.isArray(e)&&(e=[e]),i.isString(t)&&t.length){if("."===t)return this.root;t=t.split(".")}else if(!t.length)return this;if(""===t[0])return this.root.lookup(t.slice(1),e);var n=this.get(t[0]);if(n){if(1===t.length){if(!e||e.indexOf(n.constructor)>-1)return n}else if(n instanceof f&&(n=n.lookup(t.slice(1),e,!0)))return n}else for(var o=0;o<this.nestedArray.length;++o)if(this._nestedArray[o]instanceof f&&(n=this._nestedArray[o].lookup(t,e,!0)))return n;return null===this.parent||r?null:this.parent.lookup(t,e)},f.prototype.lookupType=function(t){var r=this.lookup(t,[e]);if(!r)throw Error("no such type: "+t);return r},f.prototype.lookupEnum=function(t){var e=this.lookup(t,[n]);if(!e)throw Error("no such Enum '"+t+"' in "+this);return e},f.prototype.lookupTypeOrEnum=function(t){var r=this.lookup(t,[e,n]);if(!r)throw Error("no such Type or Enum '"+t+"' in "+this);return r},f.prototype.lookupService=function(t){var e=this.lookup(t,[r]);if(!e)throw Error("no such Service '"+t+"' in "+this);return e},f._configure=function(t,o,i){e=t,r=o,n=i};
        },{"./object":"lIB1","./field":"+iVu","./util":"CVja"}],"tCFY":[function(require,module,exports) {
            "use strict";module.exports=o;var e=require("./object");((o.prototype=Object.create(e.prototype)).constructor=o).className="OneOf";var t=require("./field"),r=require("./util");function o(t,r,o,n){if(Array.isArray(r)||(o=r,r=void 0),e.call(this,t,o),void 0!==r&&!Array.isArray(r))throw TypeError("fieldNames must be an Array");this.oneof=r||[],this.fieldsArray=[],this.comment=n}function n(e){if(e.parent)for(var t=0;t<e.fieldsArray.length;++t)e.fieldsArray[t].parent||e.parent.add(e.fieldsArray[t])}o.fromJSON=function(e,t){return new o(e,t.oneof,t.options,t.comment)},o.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return r.toObject(["options",this.options,"oneof",this.oneof,"comment",t?this.comment:void 0])},o.prototype.add=function(e){if(!(e instanceof t))throw TypeError("field must be a Field");return e.parent&&e.parent!==this.parent&&e.parent.remove(e),this.oneof.push(e.name),this.fieldsArray.push(e),e.partOf=this,n(this),this},o.prototype.remove=function(e){if(!(e instanceof t))throw TypeError("field must be a Field");var r=this.fieldsArray.indexOf(e);if(r<0)throw Error(e+" is not a member of "+this);return this.fieldsArray.splice(r,1),(r=this.oneof.indexOf(e.name))>-1&&this.oneof.splice(r,1),e.partOf=null,this},o.prototype.onAdd=function(t){e.prototype.onAdd.call(this,t);for(var r=0;r<this.oneof.length;++r){var o=t.get(this.oneof[r]);o&&!o.partOf&&(o.partOf=this,this.fieldsArray.push(o))}n(this)},o.prototype.onRemove=function(t){for(var r,o=0;o<this.fieldsArray.length;++o)(r=this.fieldsArray[o]).parent&&r.parent.remove(r);e.prototype.onRemove.call(this,t)},o.d=function(){for(var e=new Array(arguments.length),t=0;t<arguments.length;)e[t]=arguments[t++];return function(t,n){r.decorateType(t.constructor).add(new o(n,e)),Object.defineProperty(t,n,{get:r.oneOfGetter(e),set:r.oneOfSetter(e)})}};
        },{"./object":"lIB1","./field":"+iVu","./util":"CVja"}],"fBNh":[function(require,module,exports) {
            "use strict";module.exports=r;var e=require("./field");((r.prototype=Object.create(e.prototype)).constructor=r).className="MapField";var t=require("./types"),o=require("./util");function r(t,r,i,n,p,s){if(e.call(this,t,r,n,void 0,void 0,p,s),!o.isString(i))throw TypeError("keyType must be a string");this.keyType=i,this.resolvedKeyType=null,this.map=!0}r.fromJSON=function(e,t){return new r(e,t.id,t.keyType,t.type,t.options,t.comment)},r.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return o.toObject(["keyType",this.keyType,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])},r.prototype.resolve=function(){if(this.resolved)return this;if(void 0===t.mapKey[this.keyType])throw Error("invalid key type: "+this.keyType);return e.prototype.resolve.call(this)},r.d=function(e,t,i){return"function"==typeof i?i=o.decorateType(i).name:i&&"object"==typeof i&&(i=o.decorateEnum(i).name),function(n,p){o.decorateType(n.constructor).add(new r(p,e,t,i))}};
        },{"./field":"+iVu","./types":"eiCH","./util":"CVja"}],"7LdZ":[function(require,module,exports) {
            "use strict";module.exports=s;var e=require("./object");((s.prototype=Object.create(e.prototype)).constructor=s).className="Method";var t=require("./util");function s(s,r,o,p,i,n,u,y){if(t.isObject(i)?(u=i,i=n=void 0):t.isObject(n)&&(u=n,n=void 0),void 0!==r&&!t.isString(r))throw TypeError("type must be a string");if(!t.isString(o))throw TypeError("requestType must be a string");if(!t.isString(p))throw TypeError("responseType must be a string");e.call(this,s,u),this.type=r||"rpc",this.requestType=o,this.requestStream=!!i||void 0,this.responseType=p,this.responseStream=!!n||void 0,this.resolvedRequestType=null,this.resolvedResponseType=null,this.comment=y}s.fromJSON=function(e,t){return new s(e,t.type,t.requestType,t.responseType,t.requestStream,t.responseStream,t.options,t.comment)},s.prototype.toJSON=function(e){var s=!!e&&Boolean(e.keepComments);return t.toObject(["type","rpc"!==this.type&&this.type||void 0,"requestType",this.requestType,"requestStream",this.requestStream,"responseType",this.responseType,"responseStream",this.responseStream,"options",this.options,"comment",s?this.comment:void 0])},s.prototype.resolve=function(){return this.resolved?this:(this.resolvedRequestType=this.parent.lookupType(this.requestType),this.resolvedResponseType=this.parent.lookupType(this.responseType),e.prototype.resolve.call(this))};
        },{"./object":"lIB1","./util":"CVja"}],"FvRI":[function(require,module,exports) {
            "use strict";module.exports=s;var e=require("./namespace");((s.prototype=Object.create(e.prototype)).constructor=s).className="Service";var t=require("./method"),r=require("./util"),o=require("./rpc");function s(t,r){e.call(this,t,r),this.methods={},this._methodsArray=null}function n(e){return e._methodsArray=null,e}s.fromJSON=function(e,r){var o=new s(e,r.options);if(r.methods)for(var n=Object.keys(r.methods),i=0;i<n.length;++i)o.add(t.fromJSON(n[i],r.methods[n[i]]));return r.nested&&o.addJSON(r.nested),o.comment=r.comment,o},s.prototype.toJSON=function(t){var o=e.prototype.toJSON.call(this,t),s=!!t&&Boolean(t.keepComments);return r.toObject(["options",o&&o.options||void 0,"methods",e.arrayToJSON(this.methodsArray,t)||{},"nested",o&&o.nested||void 0,"comment",s?this.comment:void 0])},Object.defineProperty(s.prototype,"methodsArray",{get:function(){return this._methodsArray||(this._methodsArray=r.toArray(this.methods))}}),s.prototype.get=function(t){return this.methods[t]||e.prototype.get.call(this,t)},s.prototype.resolveAll=function(){for(var t=this.methodsArray,r=0;r<t.length;++r)t[r].resolve();return e.prototype.resolve.call(this)},s.prototype.add=function(r){if(this.get(r.name))throw Error("duplicate name '"+r.name+"' in "+this);return r instanceof t?(this.methods[r.name]=r,r.parent=this,n(this)):e.prototype.add.call(this,r)},s.prototype.remove=function(r){if(r instanceof t){if(this.methods[r.name]!==r)throw Error(r+" is not a member of "+this);return delete this.methods[r.name],r.parent=null,n(this)}return e.prototype.remove.call(this,r)},s.prototype.create=function(e,t,s){for(var n,i=new o.Service(e,t,s),a=0;a<this.methodsArray.length;++a){var h=r.lcFirst((n=this._methodsArray[a]).resolve().name).replace(/[^$\w_]/g,"");i[h]=r.codegen(["r","c"],r.isReserved(h)?h+"_":h)("return this.rpcCall(m,q,s,r,c)")({m:n,q:n.resolvedRequestType.ctor,s:n.resolvedResponseType.ctor})}return i};
        },{"./namespace":"Iv+k","./method":"7LdZ","./util":"CVja","./rpc":"j3cJ"}],"DGUL":[function(require,module,exports) {
            "use strict";module.exports=e;var t=require("./util/minimal");function e(t){if(t)for(var e=Object.keys(t),i=0;i<e.length;++i)this[e[i]]=t[e[i]]}e.create=function(t){return this.$type.create(t)},e.encode=function(t,e){return this.$type.encode(t,e)},e.encodeDelimited=function(t,e){return this.$type.encodeDelimited(t,e)},e.decode=function(t){return this.$type.decode(t)},e.decodeDelimited=function(t){return this.$type.decodeDelimited(t)},e.verify=function(t){return this.$type.verify(t)},e.fromObject=function(t){return this.$type.fromObject(t)},e.toObject=function(t,e){return this.$type.toObject(t,e)},e.prototype.toJSON=function(){return this.$type.toObject(this,t.toJSONOptions)};
        },{"./util/minimal":"+OqZ"}],"8DjC":[function(require,module,exports) {
            "use strict";module.exports=t;var e=require("./enum"),r=require("./types"),s=require("./util");function i(e){return"missing required '"+e.name+"'"}function t(t){var o=s.codegen(["r","l"],t.name+"$decode")("if(!(r instanceof Reader))")("r=Reader.create(r)")("var c=l===undefined?r.len:r.pos+l,m=new this.ctor"+(t.fieldsArray.filter(function(e){return e.map}).length?",k":""))("while(r.pos<c){")("var t=r.uint32()");t.group&&o("if((t&7)===4)")("break"),o("switch(t>>>3){");for(var n=0;n<t.fieldsArray.length;++n){var a=t._fieldsArray[n].resolve(),d=a.resolvedType instanceof e?"int32":a.type,p="m"+s.safeProp(a.name);o("case %i:",a.id),a.map?(o("r.skip().pos++")("if(%s===util.emptyObject)",p)("%s={}",p)("k=r.%s()",a.keyType)("r.pos++"),void 0!==r.long[a.keyType]?void 0===r.basic[d]?o('%s[typeof k==="object"?util.longToHash(k):k]=types[%i].decode(r,r.uint32())',p,n):o('%s[typeof k==="object"?util.longToHash(k):k]=r.%s()',p,d):void 0===r.basic[d]?o("%s[k]=types[%i].decode(r,r.uint32())",p,n):o("%s[k]=r.%s()",p,d)):a.repeated?(o("if(!(%s&&%s.length))",p,p)("%s=[]",p),void 0!==r.packed[d]&&o("if((t&7)===2){")("var c2=r.uint32()+r.pos")("while(r.pos<c2)")("%s.push(r.%s())",p,d)("}else"),void 0===r.basic[d]?o(a.resolvedType.group?"%s.push(types[%i].decode(r))":"%s.push(types[%i].decode(r,r.uint32()))",p,n):o("%s.push(r.%s())",p,d)):void 0===r.basic[d]?o(a.resolvedType.group?"%s=types[%i].decode(r)":"%s=types[%i].decode(r,r.uint32())",p,n):o("%s=r.%s()",p,d),o("break")}for(o("default:")("r.skipType(t&7)")("break")("}")("}"),n=0;n<t._fieldsArray.length;++n){var u=t._fieldsArray[n];u.required&&o("if(!m.hasOwnProperty(%j))",u.name)("throw util.ProtocolError(%j,{instance:m})",i(u))}return o("return m")}
        },{"./enum":"QVBM","./types":"eiCH","./util":"CVja"}],"y8ff":[function(require,module,exports) {
            "use strict";module.exports=a;var e=require("./enum"),r=require("./util");function t(e,r){return e.name+": "+r+(e.repeated&&"array"!==r?"[]":e.map&&"object"!==r?"{k:"+e.keyType+"}":"")+" expected"}function s(r,s,i,a){if(s.resolvedType)if(s.resolvedType instanceof e){r("switch(%s){",a)("default:")("return%j",t(s,"enum value"));for(var n=Object.keys(s.resolvedType.values),u=0;u<n.length;++u)r("case %i:",s.resolvedType.values[n[u]]);r("break")("}")}else r("{")("var e=types[%i].verify(%s);",i,a)("if(e)")("return%j+e",s.name+".")("}");else switch(s.type){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":r("if(!util.isInteger(%s))",a)("return%j",t(s,"integer"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":r("if(!util.isInteger(%s)&&!(%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))",a,a,a,a)("return%j",t(s,"integer|Long"));break;case"float":case"double":r('if(typeof %s!=="number")',a)("return%j",t(s,"number"));break;case"bool":r('if(typeof %s!=="boolean")',a)("return%j",t(s,"boolean"));break;case"string":r("if(!util.isString(%s))",a)("return%j",t(s,"string"));break;case"bytes":r('if(!(%s&&typeof %s.length==="number"||util.isString(%s)))',a,a,a)("return%j",t(s,"buffer"))}return r}function i(e,r,s){switch(r.keyType){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":e("if(!util.key32Re.test(%s))",s)("return%j",t(r,"integer key"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":e("if(!util.key64Re.test(%s))",s)("return%j",t(r,"integer|Long key"));break;case"bool":e("if(!util.key2Re.test(%s))",s)("return%j",t(r,"boolean key"))}return e}function a(e){var a=r.codegen(["m"],e.name+"$verify")('if(typeof m!=="object"||m===null)')("return%j","object expected"),n={};e.oneofsArray.length&&a("var p={}");for(var u=0;u<e.fieldsArray.length;++u){var f=e._fieldsArray[u].resolve(),l="m"+r.safeProp(f.name);if(f.optional&&a("if(%s!=null&&m.hasOwnProperty(%j)){",l,f.name),f.map)a("if(!util.isObject(%s))",l)("return%j",t(f,"object"))("var k=Object.keys(%s)",l)("for(var i=0;i<k.length;++i){"),i(a,f,"k[i]"),s(a,f,u,l+"[k[i]]")("}");else if(f.repeated)a("if(!Array.isArray(%s))",l)("return%j",t(f,"array"))("for(var i=0;i<%s.length;++i){",l),s(a,f,u,l+"[i]")("}");else{if(f.partOf){var o=r.safeProp(f.partOf.name);1===n[f.partOf.name]&&a("if(p%s===1)",o)("return%j",f.partOf.name+": multiple values"),n[f.partOf.name]=1,a("p%s=1",o)}s(a,f,u,l)}f.optional&&a("}")}return a("return null")}
        },{"./enum":"QVBM","./util":"CVja"}],"Qtsa":[function(require,module,exports) {
            "use strict";var e=exports,s=require("./enum"),t=require("./util");function r(e,t,r,o){if(t.resolvedType)if(t.resolvedType instanceof s){e("switch(d%s){",o);for(var a=t.resolvedType.values,n=Object.keys(a),i=0;i<n.length;++i)t.repeated&&a[n[i]]===t.typeDefault&&e("default:"),e("case%j:",n[i])("case %i:",a[n[i]])("m%s=%j",o,a[n[i]])("break");e("}")}else e('if(typeof d%s!=="object")',o)("throw TypeError(%j)",t.fullName+": object expected")("m%s=types[%i].fromObject(d%s)",o,r,o);else{var l=!1;switch(t.type){case"double":case"float":e("m%s=Number(d%s)",o,o);break;case"uint32":case"fixed32":e("m%s=d%s>>>0",o,o);break;case"int32":case"sint32":case"sfixed32":e("m%s=d%s|0",o,o);break;case"uint64":l=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e("if(util.Long)")("(m%s=util.Long.fromValue(d%s)).unsigned=%j",o,o,l)('else if(typeof d%s==="string")',o)("m%s=parseInt(d%s,10)",o,o)('else if(typeof d%s==="number")',o)("m%s=d%s",o,o)('else if(typeof d%s==="object")',o)("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)",o,o,o,l?"true":"");break;case"bytes":e('if(typeof d%s==="string")',o)("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)",o,o,o)("else if(d%s.length)",o)("m%s=d%s",o,o);break;case"string":e("m%s=String(d%s)",o,o);break;case"bool":e("m%s=Boolean(d%s)",o,o)}}return e}function o(e,t,r,o){if(t.resolvedType)t.resolvedType instanceof s?e("d%s=o.enums===String?types[%i].values[m%s]:m%s",o,r,o,o):e("d%s=types[%i].toObject(m%s,o)",o,r,o);else{var a=!1;switch(t.type){case"double":case"float":e("d%s=o.json&&!isFinite(m%s)?String(m%s):m%s",o,o,o,o);break;case"uint64":a=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e('if(typeof m%s==="number")',o)("d%s=o.longs===String?String(m%s):m%s",o,o,o)("else")("d%s=o.longs===String?util.Long.prototype.toString.call(m%s):o.longs===Number?new util.LongBits(m%s.low>>>0,m%s.high>>>0).toNumber(%s):m%s",o,o,o,o,a?"true":"",o);break;case"bytes":e("d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s",o,o,o,o,o);break;default:e("d%s=m%s",o,o)}}return e}e.fromObject=function(e){var o=e.fieldsArray,a=t.codegen(["d"],e.name+"$fromObject")("if(d instanceof this.ctor)")("return d");if(!o.length)return a("return new this.ctor");a("var m=new this.ctor");for(var n=0;n<o.length;++n){var i=o[n].resolve(),l=t.safeProp(i.name);i.map?(a("if(d%s){",l)('if(typeof d%s!=="object")',l)("throw TypeError(%j)",i.fullName+": object expected")("m%s={}",l)("for(var ks=Object.keys(d%s),i=0;i<ks.length;++i){",l),r(a,i,n,l+"[ks[i]]")("}")("}")):i.repeated?(a("if(d%s){",l)("if(!Array.isArray(d%s))",l)("throw TypeError(%j)",i.fullName+": array expected")("m%s=[]",l)("for(var i=0;i<d%s.length;++i){",l),r(a,i,n,l+"[i]")("}")("}")):(i.resolvedType instanceof s||a("if(d%s!=null){",l),r(a,i,n,l),i.resolvedType instanceof s||a("}"))}return a("return m")},e.toObject=function(e){var r=e.fieldsArray.slice().sort(t.compareFieldsById);if(!r.length)return t.codegen()("return {}");for(var a=t.codegen(["m","o"],e.name+"$toObject")("if(!o)")("o={}")("var d={}"),n=[],i=[],l=[],f=0;f<r.length;++f)r[f].partOf||(r[f].resolve().repeated?n:r[f].map?i:l).push(r[f]);if(n.length){for(a("if(o.arrays||o.defaults){"),f=0;f<n.length;++f)a("d%s=[]",t.safeProp(n[f].name));a("}")}if(i.length){for(a("if(o.objects||o.defaults){"),f=0;f<i.length;++f)a("d%s={}",t.safeProp(i[f].name));a("}")}if(l.length){for(a("if(o.defaults){"),f=0;f<l.length;++f){var d=l[f],u=t.safeProp(d.name);if(d.resolvedType instanceof s)a("d%s=o.enums===String?%j:%j",u,d.resolvedType.valuesById[d.typeDefault],d.typeDefault);else if(d.long)a("if(util.Long){")("var n=new util.Long(%i,%i,%j)",d.typeDefault.low,d.typeDefault.high,d.typeDefault.unsigned)("d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n",u)("}else")("d%s=o.longs===String?%j:%i",u,d.typeDefault.toString(),d.typeDefault.toNumber());else if(d.bytes){var m="["+Array.prototype.slice.call(d.typeDefault).join(",")+"]";a("if(o.bytes===String)d%s=%j",u,String.fromCharCode.apply(String,d.typeDefault))("else{")("d%s=%s",u,m)("if(o.bytes!==Array)d%s=util.newBuffer(d%s)",u,u)("}")}else a("d%s=%j",u,d.typeDefault)}a("}")}var c=!1;for(f=0;f<r.length;++f){d=r[f];var p=e._fieldsArray.indexOf(d);u=t.safeProp(d.name);d.map?(c||(c=!0,a("var ks2")),a("if(m%s&&(ks2=Object.keys(m%s)).length){",u,u)("d%s={}",u)("for(var j=0;j<ks2.length;++j){"),o(a,d,p,u+"[ks2[j]]")("}")):d.repeated?(a("if(m%s&&m%s.length){",u,u)("d%s=[]",u)("for(var j=0;j<m%s.length;++j){",u),o(a,d,p,u+"[j]")("}")):(a("if(m%s!=null&&m.hasOwnProperty(%j)){",u,d.name),o(a,d,p,u),d.partOf&&a("if(o.oneofs)")("d%s=%j",t.safeProp(d.partOf.name),d.name)),a("}")}return a("return d")};
        },{"./enum":"QVBM","./util":"CVja"}],"XU0z":[function(require,module,exports) {
            "use strict";var t=exports,e=require("./message");t[".google.protobuf.Any"]={fromObject:function(t){if(t&&t["@type"]){var e=this.lookup(t["@type"]);if(e){var r="."===t["@type"].charAt(0)?t["@type"].substr(1):t["@type"];return this.create({type_url:"/"+r,value:e.encode(e.fromObject(t)).finish()})}}return this.fromObject(t)},toObject:function(t,r){if(r&&r.json&&t.type_url&&t.value){var o=t.type_url.substring(t.type_url.lastIndexOf("/")+1),u=this.lookup(o);u&&(t=u.decode(t.value))}if(!(t instanceof this.ctor)&&t instanceof e){var s=t.$type.toObject(t,r);return s["@type"]=t.$type.fullName,s}return this.toObject(t,r)}};
        },{"./message":"DGUL"}],"/lgn":[function(require,module,exports) {
            "use strict";module.exports=y;var e=require("./namespace");((y.prototype=Object.create(e.prototype)).constructor=y).className="Type";var t=require("./enum"),r=require("./oneof"),i=require("./field"),o=require("./mapfield"),s=require("./service"),n=require("./message"),d=require("./reader"),f=require("./writer"),h=require("./util"),l=require("./encoder"),a=require("./decoder"),u=require("./verifier"),c=require("./converter"),p=require("./wrappers");function y(t,r){e.call(this,t,r),this.fields={},this.oneofs=void 0,this.extensions=void 0,this.reserved=void 0,this.group=void 0,this._fieldsById=null,this._fieldsArray=null,this._oneofsArray=null,this._ctor=null}function v(e){return e._fieldsById=e._fieldsArray=e._oneofsArray=null,delete e.encode,delete e.decode,delete e.verify,e}Object.defineProperties(y.prototype,{fieldsById:{get:function(){if(this._fieldsById)return this._fieldsById;this._fieldsById={};for(var e=Object.keys(this.fields),t=0;t<e.length;++t){var r=this.fields[e[t]],i=r.id;if(this._fieldsById[i])throw Error("duplicate id "+i+" in "+this);this._fieldsById[i]=r}return this._fieldsById}},fieldsArray:{get:function(){return this._fieldsArray||(this._fieldsArray=h.toArray(this.fields))}},oneofsArray:{get:function(){return this._oneofsArray||(this._oneofsArray=h.toArray(this.oneofs))}},ctor:{get:function(){return this._ctor||(this.ctor=y.generateConstructor(this)())},set:function(e){var t=e.prototype;t instanceof n||((e.prototype=new n).constructor=e,h.merge(e.prototype,t)),e.$type=e.prototype.$type=this,h.merge(e,n,!0),this._ctor=e;for(var r=0;r<this.fieldsArray.length;++r)this._fieldsArray[r].resolve();var i={};for(r=0;r<this.oneofsArray.length;++r)i[this._oneofsArray[r].resolve().name]={get:h.oneOfGetter(this._oneofsArray[r].oneof),set:h.oneOfSetter(this._oneofsArray[r].oneof)};r&&Object.defineProperties(e.prototype,i)}}}),y.generateConstructor=function(e){for(var t,r=h.codegen(["p"],e.name),i=0;i<e.fieldsArray.length;++i)(t=e._fieldsArray[i]).map?r("this%s={}",h.safeProp(t.name)):t.repeated&&r("this%s=[]",h.safeProp(t.name));return r("if(p)for(var ks=Object.keys(p),i=0;i<ks.length;++i)if(p[ks[i]]!=null)")("this[ks[i]]=p[ks[i]]")},y.fromJSON=function(n,d){var f=new y(n,d.options);f.extensions=d.extensions,f.reserved=d.reserved;for(var h=Object.keys(d.fields),l=0;l<h.length;++l)f.add((void 0!==d.fields[h[l]].keyType?o.fromJSON:i.fromJSON)(h[l],d.fields[h[l]]));if(d.oneofs)for(h=Object.keys(d.oneofs),l=0;l<h.length;++l)f.add(r.fromJSON(h[l],d.oneofs[h[l]]));if(d.nested)for(h=Object.keys(d.nested),l=0;l<h.length;++l){var a=d.nested[h[l]];f.add((void 0!==a.id?i.fromJSON:void 0!==a.fields?y.fromJSON:void 0!==a.values?t.fromJSON:void 0!==a.methods?s.fromJSON:e.fromJSON)(h[l],a))}return d.extensions&&d.extensions.length&&(f.extensions=d.extensions),d.reserved&&d.reserved.length&&(f.reserved=d.reserved),d.group&&(f.group=!0),d.comment&&(f.comment=d.comment),f},y.prototype.toJSON=function(t){var r=e.prototype.toJSON.call(this,t),i=!!t&&Boolean(t.keepComments);return h.toObject(["options",r&&r.options||void 0,"oneofs",e.arrayToJSON(this.oneofsArray,t),"fields",e.arrayToJSON(this.fieldsArray.filter(function(e){return!e.declaringField}),t)||{},"extensions",this.extensions&&this.extensions.length?this.extensions:void 0,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"group",this.group||void 0,"nested",r&&r.nested||void 0,"comment",i?this.comment:void 0])},y.prototype.resolveAll=function(){for(var t=this.fieldsArray,r=0;r<t.length;)t[r++].resolve();var i=this.oneofsArray;for(r=0;r<i.length;)i[r++].resolve();return e.prototype.resolveAll.call(this)},y.prototype.get=function(e){return this.fields[e]||this.oneofs&&this.oneofs[e]||this.nested&&this.nested[e]||null},y.prototype.add=function(t){if(this.get(t.name))throw Error("duplicate name '"+t.name+"' in "+this);if(t instanceof i&&void 0===t.extend){if(this._fieldsById?this._fieldsById[t.id]:this.fieldsById[t.id])throw Error("duplicate id "+t.id+" in "+this);if(this.isReservedId(t.id))throw Error("id "+t.id+" is reserved in "+this);if(this.isReservedName(t.name))throw Error("name '"+t.name+"' is reserved in "+this);return t.parent&&t.parent.remove(t),this.fields[t.name]=t,t.message=this,t.onAdd(this),v(this)}return t instanceof r?(this.oneofs||(this.oneofs={}),this.oneofs[t.name]=t,t.onAdd(this),v(this)):e.prototype.add.call(this,t)},y.prototype.remove=function(t){if(t instanceof i&&void 0===t.extend){if(!this.fields||this.fields[t.name]!==t)throw Error(t+" is not a member of "+this);return delete this.fields[t.name],t.parent=null,t.onRemove(this),v(this)}if(t instanceof r){if(!this.oneofs||this.oneofs[t.name]!==t)throw Error(t+" is not a member of "+this);return delete this.oneofs[t.name],t.parent=null,t.onRemove(this),v(this)}return e.prototype.remove.call(this,t)},y.prototype.isReservedId=function(t){return e.isReservedId(this.reserved,t)},y.prototype.isReservedName=function(t){return e.isReservedName(this.reserved,t)},y.prototype.create=function(e){return new this.ctor(e)},y.prototype.setup=function(){for(var e=this.fullName,t=[],r=0;r<this.fieldsArray.length;++r)t.push(this._fieldsArray[r].resolve().resolvedType);this.encode=l(this)({Writer:f,types:t,util:h}),this.decode=a(this)({Reader:d,types:t,util:h}),this.verify=u(this)({types:t,util:h}),this.fromObject=c.fromObject(this)({types:t,util:h}),this.toObject=c.toObject(this)({types:t,util:h});var i=p[e];if(i){var o=Object.create(this);o.fromObject=this.fromObject,this.fromObject=i.fromObject.bind(o),o.toObject=this.toObject,this.toObject=i.toObject.bind(o)}return this},y.prototype.encode=function(e,t){return this.setup().encode(e,t)},y.prototype.encodeDelimited=function(e,t){return this.encode(e,t&&t.len?t.fork():t).ldelim()},y.prototype.decode=function(e,t){return this.setup().decode(e,t)},y.prototype.decodeDelimited=function(e){return e instanceof d||(e=d.create(e)),this.decode(e,e.uint32())},y.prototype.verify=function(e){return this.setup().verify(e)},y.prototype.fromObject=function(e){return this.setup().fromObject(e)},y.prototype.toObject=function(e,t){return this.setup().toObject(e,t)},y.d=function(e){return function(t){h.decorateType(t,e)}};
        },{"./namespace":"Iv+k","./enum":"QVBM","./oneof":"tCFY","./field":"+iVu","./mapfield":"fBNh","./service":"FvRI","./message":"DGUL","./reader":"nX4I","./writer":"uteQ","./util":"CVja","./encoder":"bDtv","./decoder":"8DjC","./verifier":"y8ff","./converter":"Qtsa","./wrappers":"XU0z"}],"g5I+":[function(require,module,exports) {

            var t,e,n=module.exports={};function r(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function i(e){if(t===setTimeout)return setTimeout(e,0);if((t===r||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}function u(t){if(e===clearTimeout)return clearTimeout(t);if((e===o||!e)&&clearTimeout)return e=clearTimeout,clearTimeout(t);try{return e(t)}catch(n){try{return e.call(null,t)}catch(n){return e.call(this,t)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:r}catch(n){t=r}try{e="function"==typeof clearTimeout?clearTimeout:o}catch(n){e=o}}();var c,s=[],l=!1,a=-1;function f(){l&&c&&(l=!1,c.length?s=c.concat(s):a=-1,s.length&&h())}function h(){if(!l){var t=i(f);l=!0;for(var e=s.length;e;){for(c=s,s=[];++a<e;)c&&c[a].run();a=-1,e=s.length}c=null,l=!1,u(t)}}function m(t,e){this.fun=t,this.array=e}function p(){}n.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];s.push(new m(t,e)),1!==s.length||l||i(h)},m.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.env={},n.argv=[],n.version="",n.versions={},n.on=p,n.addListener=p,n.once=p,n.off=p,n.removeListener=p,n.removeAllListeners=p,n.emit=p,n.prependListener=p,n.prependOnceListener=p,n.listeners=function(t){return[]},n.binding=function(t){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(t){throw new Error("process.chdir is not supported")},n.umask=function(){return 0};
        },{}],"Jato":[function(require,module,exports) {
            var process = require("process");
            var e=require("process");module.exports=l;var t=require("./namespace");((l.prototype=Object.create(t.prototype)).constructor=l).className="Root";var n,r,i,o=require("./field"),s=require("./enum"),a=require("./oneof"),f=require("./util");function l(e){t.call(this,"",e),this.deferred=[],this.files=[]}function d(){}l.fromJSON=function(e,t){return t||(t=new l),e.options&&t.setOptions(e.options),t.addJSON(e.nested)},l.prototype.resolvePath=f.path.resolve,l.prototype.load=function e(t,n,o){"function"==typeof n&&(o=n,n=void 0);var s=this;if(!o)return f.asPromise(e,s,t,n);var a=o===d;function l(e,t){if(o){var n=o;if(o=null,a)throw e;n(e,t)}}function u(e,t){try{if(f.isString(t)&&"{"===t.charAt(0)&&(t=JSON.parse(t)),f.isString(t)){r.filename=e;var i,o=r(t,s,n),d=0;if(o.imports)for(;d<o.imports.length;++d)(i=s.resolvePath(e,o.imports[d]))&&p(i);if(o.weakImports)for(d=0;d<o.weakImports.length;++d)(i=s.resolvePath(e,o.weakImports[d]))&&p(i,!0)}else s.setOptions(t.options).addJSON(t.nested)}catch(u){l(u)}a||c||l(null,s)}function p(e,t){var n=e.lastIndexOf("google/protobuf/");if(n>-1){var r=e.substring(n);r in i&&(e=r)}if(!(s.files.indexOf(e)>-1))if(s.files.push(e),e in i)a?u(e,i[e]):(++c,setTimeout(function(){--c,u(e,i[e])}));else if(a){var d;try{d=f.fs.readFileSync(e).toString("utf8")}catch(p){return void(t||l(p))}u(e,d)}else++c,f.fetch(e,function(n,r){--c,o&&(n?t?c||l(null,s):l(n):u(e,r))})}var c=0;f.isString(t)&&(t=[t]);for(var h,v=0;v<t.length;++v)(h=s.resolvePath("",t[v]))&&p(h);if(a)return s;c||l(null,s)},l.prototype.loadSync=function(e,t){if(!f.isNode)throw Error("not supported");return this.load(e,t,d)},l.prototype.resolveAll=function(){if(this.deferred.length)throw Error("unresolvable extensions: "+this.deferred.map(function(e){return"'extend "+e.extend+"' in "+e.parent.fullName}).join(", "));return t.prototype.resolveAll.call(this)};var u=/^[A-Z]/;function p(e,t){var n=t.parent.lookup(t.extend);if(n){var r=new o(t.fullName,t.id,t.type,t.rule,void 0,t.options);return r.declaringField=t,t.extensionField=r,n.add(r),!0}return!1}l.prototype._handleAdd=function(e){if(e instanceof o)void 0===e.extend||e.extensionField||p(this,e)||this.deferred.push(e);else if(e instanceof s)u.test(e.name)&&(e.parent[e.name]=e.values);else if(!(e instanceof a)){if(e instanceof n)for(var t=0;t<this.deferred.length;)p(this,this.deferred[t])?this.deferred.splice(t,1):++t;for(var r=0;r<e.nestedArray.length;++r)this._handleAdd(e._nestedArray[r]);u.test(e.name)&&(e.parent[e.name]=e)}},l.prototype._handleRemove=function(e){if(e instanceof o){if(void 0!==e.extend)if(e.extensionField)e.extensionField.parent.remove(e.extensionField),e.extensionField=null;else{var n=this.deferred.indexOf(e);n>-1&&this.deferred.splice(n,1)}}else if(e instanceof s)u.test(e.name)&&delete e.parent[e.name];else if(e instanceof t){for(var r=0;r<e.nestedArray.length;++r)this._handleRemove(e._nestedArray[r]);u.test(e.name)&&delete e.parent[e.name]}},l._configure=function(e,t,o){n=e,r=t,i=o};
        },{"./namespace":"Iv+k","./field":"+iVu","./enum":"QVBM","./oneof":"tCFY","./util":"CVja","process":"g5I+"}],"CVja":[function(require,module,exports) {
            "use strict";var e,t,r=module.exports=require("./util/minimal"),n=require("./roots");r.codegen=require("@protobufjs/codegen"),r.fetch=require("@protobufjs/fetch"),r.path=require("@protobufjs/path"),r.fs=r.inquire("fs"),r.toArray=function(e){if(e){for(var t=Object.keys(e),r=new Array(t.length),n=0;n<t.length;)r[n]=e[t[n++]];return r}return[]},r.toObject=function(e){for(var t={},r=0;r<e.length;){var n=e[r++],o=e[r++];void 0!==o&&(t[n]=o)}return t};var o=/\\/g,u=/"/g;r.isReserved=function(e){return/^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/.test(e)},r.safeProp=function(e){return!/^[$\w_]+$/.test(e)||r.isReserved(e)?'["'+e.replace(o,"\\\\").replace(u,'\\"')+'"]':"."+e},r.ucFirst=function(e){return e.charAt(0).toUpperCase()+e.substring(1)};var a=/_([a-z])/g;r.camelCase=function(e){return e.substring(0,1)+e.substring(1).replace(a,function(e,t){return t.toUpperCase()})},r.compareFieldsById=function(e,t){return e.id-t.id},r.decorateType=function(t,n){if(t.$type)return n&&t.$type.name!==n&&(r.decorateRoot.remove(t.$type),t.$type.name=n,r.decorateRoot.add(t.$type)),t.$type;e||(e=require("./type"));var o=new e(n||t.name);return r.decorateRoot.add(o),o.ctor=t,Object.defineProperty(t,"$type",{value:o,enumerable:!1}),Object.defineProperty(t.prototype,"$type",{value:o,enumerable:!1}),o};var i=0;r.decorateEnum=function(e){if(e.$type)return e.$type;t||(t=require("./enum"));var n=new t("Enum"+i++,e);return r.decorateRoot.add(n),Object.defineProperty(e,"$type",{value:n,enumerable:!1}),n},Object.defineProperty(r,"decorateRoot",{get:function(){return n.decorated||(n.decorated=new(require("./root")))}});
        },{"./util/minimal":"+OqZ","./roots":"S/PD","@protobufjs/codegen":"YmP9","@protobufjs/fetch":"h5wE","@protobufjs/path":"Mao7","./type":"/lgn","./enum":"QVBM","./root":"Jato"}],"lIB1":[function(require,module,exports) {
            "use strict";module.exports=e,e.className="ReflectionObject";var t,o=require("./util");function e(t,e){if(!o.isString(t))throw TypeError("name must be a string");if(e&&!o.isObject(e))throw TypeError("options must be an object");this.options=e,this.name=t,this.parent=null,this.resolved=!1,this.comment=null,this.filename=null}Object.defineProperties(e.prototype,{root:{get:function(){for(var t=this;null!==t.parent;)t=t.parent;return t}},fullName:{get:function(){for(var t=[this.name],o=this.parent;o;)t.unshift(o.name),o=o.parent;return t.join(".")}}}),e.prototype.toJSON=function(){throw Error()},e.prototype.onAdd=function(o){this.parent&&this.parent!==o&&this.parent.remove(this),this.parent=o,this.resolved=!1;var e=o.root;e instanceof t&&e._handleAdd(this)},e.prototype.onRemove=function(o){var e=o.root;e instanceof t&&e._handleRemove(this),this.parent=null,this.resolved=!1},e.prototype.resolve=function(){return this.resolved?this:(this.root instanceof t&&(this.resolved=!0),this)},e.prototype.getOption=function(t){if(this.options)return this.options[t]},e.prototype.setOption=function(t,o,e){return e&&this.options&&void 0!==this.options[t]||((this.options||(this.options={}))[t]=o),this},e.prototype.setOptions=function(t,o){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)this.setOption(e[n],t[e[n]],o);return this},e.prototype.toString=function(){var t=this.constructor.className,o=this.fullName;return o.length?t+" "+o:t},e._configure=function(o){t=o};
        },{"./util":"CVja"}],"QVBM":[function(require,module,exports) {
            "use strict";module.exports=r;var e=require("./object");((r.prototype=Object.create(e.prototype)).constructor=r).className="Enum";var t=require("./namespace"),s=require("./util");function r(t,s,r,i,o){if(e.call(this,t,r),s&&"object"!=typeof s)throw TypeError("values must be an object");if(this.valuesById={},this.values=Object.create(this.valuesById),this.comment=i,this.comments=o||{},this.reserved=void 0,s)for(var n=Object.keys(s),h=0;h<n.length;++h)"number"==typeof s[n[h]]&&(this.valuesById[this.values[n[h]]=s[n[h]]]=n[h])}r.fromJSON=function(e,t){var s=new r(e,t.values,t.options,t.comment,t.comments);return s.reserved=t.reserved,s},r.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return s.toObject(["options",this.options,"values",this.values,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"comment",t?this.comment:void 0,"comments",t?this.comments:void 0])},r.prototype.add=function(e,t,r){if(!s.isString(e))throw TypeError("name must be a string");if(!s.isInteger(t))throw TypeError("id must be an integer");if(void 0!==this.values[e])throw Error("duplicate name '"+e+"' in "+this);if(this.isReservedId(t))throw Error("id "+t+" is reserved in "+this);if(this.isReservedName(e))throw Error("name '"+e+"' is reserved in "+this);if(void 0!==this.valuesById[t]){if(!this.options||!this.options.allow_alias)throw Error("duplicate id "+t+" in "+this);this.values[e]=t}else this.valuesById[this.values[e]=t]=e;return this.comments[e]=r||null,this},r.prototype.remove=function(e){if(!s.isString(e))throw TypeError("name must be a string");var t=this.values[e];if(null==t)throw Error("name '"+e+"' does not exist in "+this);return delete this.valuesById[t],delete this.values[e],delete this.comments[e],this},r.prototype.isReservedId=function(e){return t.isReservedId(this.reserved,e)},r.prototype.isReservedName=function(e){return t.isReservedName(this.reserved,e)};
        },{"./object":"lIB1","./namespace":"Iv+k","./util":"CVja"}],"bDtv":[function(require,module,exports) {
            "use strict";module.exports=n;var e=require("./enum"),i=require("./types"),r=require("./util");function s(e,i,r,s){return i.resolvedType.group?e("types[%i].encode(%s,w.uint32(%i)).uint32(%i)",r,s,(i.id<<3|3)>>>0,(i.id<<3|4)>>>0):e("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()",r,s,(i.id<<3|2)>>>0)}function n(n){for(var t,o=r.codegen(["m","w"],n.name+"$encode")("if(!w)")("w=Writer.create()"),d=n.fieldsArray.slice().sort(r.compareFieldsById),l=0;l<d.length;++l){var u=d[l].resolve(),a=n._fieldsArray.indexOf(u),p=u.resolvedType instanceof e?"int32":u.type,f=i.basic[p];t="m"+r.safeProp(u.name),u.map?(o("if(%s!=null&&m.hasOwnProperty(%j)){",t,u.name)("for(var ks=Object.keys(%s),i=0;i<ks.length;++i){",t)("w.uint32(%i).fork().uint32(%i).%s(ks[i])",(u.id<<3|2)>>>0,8|i.mapKey[u.keyType],u.keyType),void 0===f?o("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()",a,t):o(".uint32(%i).%s(%s[ks[i]]).ldelim()",16|f,p,t),o("}")("}")):u.repeated?(o("if(%s!=null&&%s.length){",t,t),u.packed&&void 0!==i.packed[p]?o("w.uint32(%i).fork()",(u.id<<3|2)>>>0)("for(var i=0;i<%s.length;++i)",t)("w.%s(%s[i])",p,t)("w.ldelim()"):(o("for(var i=0;i<%s.length;++i)",t),void 0===f?s(o,u,a,t+"[i]"):o("w.uint32(%i).%s(%s[i])",(u.id<<3|f)>>>0,p,t)),o("}")):(u.optional&&o("if(%s!=null&&m.hasOwnProperty(%j))",t,u.name),void 0===f?s(o,u,a,t):o("w.uint32(%i).%s(%s)",(u.id<<3|f)>>>0,p,t))}return o("return w")}
        },{"./enum":"QVBM","./types":"eiCH","./util":"CVja"}],"wgyk":[function(require,module,exports) {
            "use strict";var e=module.exports=require("./index-minimal");function r(r,i,o){return"function"==typeof i?(o=i,i=new e.Root):i||(i=new e.Root),i.load(r,o)}function i(r,i){return i||(i=new e.Root),i.loadSync(r)}e.build="light",e.load=r,e.loadSync=i,e.encoder=require("./encoder"),e.decoder=require("./decoder"),e.verifier=require("./verifier"),e.converter=require("./converter"),e.ReflectionObject=require("./object"),e.Namespace=require("./namespace"),e.Root=require("./root"),e.Enum=require("./enum"),e.Type=require("./type"),e.Field=require("./field"),e.OneOf=require("./oneof"),e.MapField=require("./mapfield"),e.Service=require("./service"),e.Method=require("./method"),e.Message=require("./message"),e.wrappers=require("./wrappers"),e.types=require("./types"),e.util=require("./util"),e.ReflectionObject._configure(e.Root),e.Namespace._configure(e.Type,e.Service,e.Enum),e.Root._configure(e.Type),e.Field._configure(e.Type);
        },{"./index-minimal":"6BiI","./encoder":"bDtv","./decoder":"8DjC","./verifier":"y8ff","./converter":"Qtsa","./object":"lIB1","./namespace":"Iv+k","./root":"Jato","./enum":"QVBM","./type":"/lgn","./field":"+iVu","./oneof":"tCFY","./mapfield":"fBNh","./service":"FvRI","./method":"7LdZ","./message":"DGUL","./wrappers":"XU0z","./types":"eiCH","./util":"CVja"}],"BwgP":[function(require,module,exports) {
            "use strict";module.exports=c;var n=/[\s{}=;:[\],'"()<>]/g,r=/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,t=/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,e=/^ *[*\/]+ */,i=/^\s*\*?\/*/,u=/\n/g,l=/\s/,f=/\\(.?)/g,o={0:"\0",r:"\r",n:"\n",t:"\t"};function s(n){return n.replace(f,function(n,r){switch(r){case"\\":case"":return r;default:return o[r]||""}})}function c(f,o){f=f.toString();var c=0,a=f.length,h=1,g=null,v=null,d=0,p=!1,m=[],w=null;function x(n){return Error("illegal "+n+" (line "+h+")")}function b(n){return f.charAt(n)}function k(n,r){g=f.charAt(n++),d=h,p=!1;var t,l=n-(o?2:3);do{if(--l<0||"\n"===(t=f.charAt(l))){p=!0;break}}while(" "===t||"\t"===t);for(var s=f.substring(n,r).split(u),c=0;c<s.length;++c)s[c]=s[c].replace(o?i:e,"").trim();v=s.join("\n").trim()}function A(n){var r=I(n),t=f.substring(n,r);return/^\s*\/{1,2}/.test(t)}function I(n){for(var r=n;r<a&&"\n"!==b(r);)r++;return r}function j(){if(m.length>0)return m.shift();if(w)return function(){var n="'"===w?t:r;n.lastIndex=c-1;var e=n.exec(f);if(!e)throw x("string");return c=n.lastIndex,y(w),w=null,s(e[1])}();var e,i,u,g,v;do{if(c===a)return null;for(e=!1;l.test(u=b(c));)if("\n"===u&&++h,++c===a)return null;if("/"===b(c)){if(++c===a)throw x("comment");if("/"===b(c))if(o){if(g=c,v=!1,A(c)){v=!0;do{if((c=I(c))===a)break;c++}while(A(c))}else c=Math.min(a,I(c)+1);v&&k(g,c),h++,e=!0}else{for(v="/"===b(g=c+1);"\n"!==b(++c);)if(c===a)return null;++c,v&&k(g,c-1),++h,e=!0}else{if("*"!==(u=b(c)))return"/";g=c+1,v=o||"*"===b(g);do{if("\n"===u&&++h,++c===a)throw x("comment");i=u,u=b(c)}while("*"!==i||"/"!==u);++c,v&&k(g,c-2),e=!0}}}while(e);var d=c;if(n.lastIndex=0,!n.test(b(d++)))for(;d<a&&!n.test(b(d));)++d;var p=f.substring(c,c=d);return'"'!==p&&"'"!==p||(w=p),p}function y(n){m.push(n)}function E(){if(!m.length){var n=j();if(null===n)return null;y(n)}return m[0]}return Object.defineProperty({next:j,peek:E,push:y,skip:function(n,r){var t=E();if(t===n)return j(),!0;if(!r)throw x("token '"+t+"', '"+n+"' expected");return!1},cmnt:function(n){var r=null;return void 0===n?d===h-1&&(o||"*"===g||p)&&(r=v):(d<n&&E(),d!==n||p||!o&&"/"!==g||(r=v)),r}},"line",{get:function(){return h}})}c.unescape=s;
        },{}],"9lF6":[function(require,module,exports) {
            "use strict";module.exports=q,q.filename=null,q.defaults={keepCase:!1};var e=require("./tokenize"),t=require("./root"),r=require("./type"),n=require("./field"),a=require("./mapfield"),i=require("./oneof"),o=require("./enum"),s=require("./service"),c=require("./method"),f=require("./types"),u=require("./util"),p=/^[1-9][0-9]*$/,w=/^-?[1-9][0-9]*$/,h=/^0[x][0-9a-fA-F]+$/,d=/^-?0[x][0-9a-fA-F]+$/,l=/^0[0-7]+$/,m=/^-?0[0-7]+$/,v=/^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/,k=/^[a-zA-Z_][a-zA-Z_0-9]*$/,b=/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/,A=/^(?:\.[a-zA-Z_][a-zA-Z_0-9]*)+$/;function q(x,y,$){y instanceof t||($=y,y=new t),$||($=q.defaults);var g,z,I,N,Z,_=e(x,$.alternateCommentMode||!1),F=_.next,E=_.push,C=_.peek,M=_.skip,O=_.cmnt,j=!0,K=!1,L=y,R=$.keepCase?function(e){return e}:u.camelCase;function S(e,t,r){var n=q.filename;return r||(q.filename=null),Error("illegal "+(t||"token")+" '"+e+"' ("+(n?n+", ":"")+"line "+_.line+")")}function T(){var e,t=[];do{if('"'!==(e=F())&&"'"!==e)throw S(e);t.push(F()),M(e),e=C()}while('"'===e||"'"===e);return t.join("")}function U(e){var t=F();switch(t){case"'":case'"':return E(t),T();case"true":case"TRUE":return!0;case"false":case"FALSE":return!1}try{return function(e,t){var r=1;"-"===e.charAt(0)&&(r=-1,e=e.substring(1));switch(e){case"inf":case"INF":case"Inf":return r*(1/0);case"nan":case"NAN":case"Nan":case"NaN":return NaN;case"0":return 0}if(p.test(e))return r*parseInt(e,10);if(h.test(e))return r*parseInt(e,16);if(l.test(e))return r*parseInt(e,8);if(v.test(e))return r*parseFloat(e);throw S(e,"number",t)}(t,!0)}catch(r){if(e&&b.test(t))return t;throw S(t,"value")}}function X(e,t){var r,n;do{!t||'"'!==(r=C())&&"'"!==r?e.push([n=B(F()),M("to",!0)?B(F()):n]):e.push(T())}while(M(",",!0));M(";")}function B(e,t){switch(e){case"max":case"MAX":case"Max":return 536870911;case"0":return 0}if(!t&&"-"===e.charAt(0))throw S(e,"id");if(w.test(e))return parseInt(e,10);if(d.test(e))return parseInt(e,16);if(m.test(e))return parseInt(e,8);throw S(e,"id")}function D(){if(void 0!==g)throw S("package");if(g=F(),!b.test(g))throw S(g,"name");L=L.define(g),M(";")}function G(){var e,t=C();switch(t){case"weak":e=I||(I=[]),F();break;case"public":F();default:e=z||(z=[])}t=T(),M(";"),e.push(t)}function H(){if(M("="),N=T(),!(K="proto3"===N)&&"proto2"!==N)throw S(N,"syntax");M(";")}function J(e,t){switch(t){case"option":return V(e,t),M(";"),!0;case"message":return function(e,t){if(!k.test(t=F()))throw S(t,"type name");var n=new r(t);P(n,function(e){if(!J(n,e))switch(e){case"map":!function(e){M("<");var t=F();if(void 0===f.mapKey[t])throw S(t,"type");M(",");var r=F();if(!b.test(r))throw S(r,"type");M(">");var n=F();if(!k.test(n))throw S(n,"name");M("=");var i=new a(R(n),B(F()),t,r);P(i,function(e){if("option"!==e)throw S(e);V(i,e),M(";")},function(){ee(i)}),e.add(i)}(n);break;case"required":case"optional":case"repeated":Q(n,e);break;case"oneof":!function(e,t){if(!k.test(t=F()))throw S(t,"name");var r=new i(R(t));P(r,function(e){"option"===e?(V(r,e),M(";")):(E(e),Q(r,"optional"))}),e.add(r)}(n,e);break;case"extensions":X(n.extensions||(n.extensions=[]));break;case"reserved":X(n.reserved||(n.reserved=[]),!0);break;default:if(!K||!b.test(e))throw S(e);E(e),Q(n,"optional")}}),e.add(n)}(e,t),!0;case"enum":return function(e,t){if(!k.test(t=F()))throw S(t,"name");var r=new o(t);P(r,function(e){switch(e){case"option":V(r,e),M(";");break;case"reserved":X(r.reserved||(r.reserved=[]),!0);break;default:!function(e,t){if(!k.test(t))throw S(t,"name");M("=");var r=B(F(),!0),n={};P(n,function(e){if("option"!==e)throw S(e);V(n,e),M(";")},function(){ee(n)}),e.add(t,r,n.comment)}(r,e)}}),e.add(r)}(e,t),!0;case"service":return function(e,t){if(!k.test(t=F()))throw S(t,"service name");var r=new s(t);P(r,function(e){if(!J(r,e)){if("rpc"!==e)throw S(e);!function(e,t){var r=t;if(!k.test(t=F()))throw S(t,"name");var n,a,i,o,s=t;M("("),M("stream",!0)&&(a=!0);if(!b.test(t=F()))throw S(t);n=t,M(")"),M("returns"),M("("),M("stream",!0)&&(o=!0);if(!b.test(t=F()))throw S(t);i=t,M(")");var f=new c(s,r,n,i,a,o);P(f,function(e){if("option"!==e)throw S(e);V(f,e),M(";")}),e.add(f)}(r,e)}}),e.add(r)}(e,t),!0;case"extend":return function(e,t){if(!b.test(t=F()))throw S(t,"reference");var r=t;P(null,function(t){switch(t){case"required":case"repeated":case"optional":Q(e,t,r);break;default:if(!K||!b.test(t))throw S(t);E(t),Q(e,"optional",r)}})}(e,t),!0}return!1}function P(e,t,r){var n=_.line;if(e&&(e.comment=O(),e.filename=q.filename),M("{",!0)){for(var a;"}"!==(a=F());)t(a);M(";",!0)}else r&&r(),M(";"),e&&"string"!=typeof e.comment&&(e.comment=O(n))}function Q(e,t,a){var i=F();if("group"!==i){if(!b.test(i))throw S(i,"type");var o=F();if(!k.test(o))throw S(o,"name");o=R(o),M("=");var s=new n(o,B(F()),i,t,a);P(s,function(e){if("option"!==e)throw S(e);V(s,e),M(";")},function(){ee(s)}),e.add(s),K||!s.repeated||void 0===f.packed[i]&&void 0!==f.basic[i]||s.setOption("packed",!1,!0)}else!function(e,t){var a=F();if(!k.test(a))throw S(a,"name");var i=u.lcFirst(a);a===i&&(a=u.ucFirst(a));M("=");var o=B(F()),s=new r(a);s.group=!0;var c=new n(i,o,a,t);c.filename=q.filename,P(s,function(e){switch(e){case"option":V(s,e),M(";");break;case"required":case"optional":case"repeated":Q(s,e);break;default:throw S(e)}}),e.add(s).add(c)}(e,t)}function V(e,t){var r=M("(",!0);if(!b.test(t=F()))throw S(t,"name");var n=t;r&&(M(")"),n="("+n+")",t=C(),A.test(t)&&(n+=t,F())),M("="),W(e,n)}function W(e,t){if(M("{",!0))do{if(!k.test(Z=F()))throw S(Z,"name");"{"===C()?W(e,t+"."+Z):(M(":"),"{"===C()?W(e,t+"."+Z):Y(e,t+"."+Z,U(!0))),M(",",!0)}while(!M("}",!0));else Y(e,t,U(!0))}function Y(e,t,r){e.setOption&&e.setOption(t,r)}function ee(e){if(M("[",!0)){do{V(e,"option")}while(M(",",!0));M("]")}return e}for(;null!==(Z=F());)switch(Z){case"package":if(!j)throw S(Z);D();break;case"import":if(!j)throw S(Z);G();break;case"syntax":if(!j)throw S(Z);H();break;case"option":if(!j)throw S(Z);V(L,Z),M(";");break;default:if(J(L,Z)){j=!1;continue}throw S(Z)}return q.filename=null,{package:g,imports:z,weakImports:I,syntax:N,root:y}}
        },{"./tokenize":"BwgP","./root":"Jato","./type":"/lgn","./field":"+iVu","./mapfield":"fBNh","./oneof":"tCFY","./enum":"QVBM","./service":"FvRI","./method":"7LdZ","./types":"eiCH","./util":"CVja"}],"A41Z":[function(require,module,exports) {
            "use strict";module.exports=t;var e,l=/\/|\./;function t(e,u){l.test(e)||(e="google/protobuf/"+e+".proto",u={nested:{google:{nested:{protobuf:{nested:u}}}}}),t[e]=u}t("any",{Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}}}),t("duration",{Duration:e={fields:{seconds:{type:"int64",id:1},nanos:{type:"int32",id:2}}}}),t("timestamp",{Timestamp:e}),t("empty",{Empty:{fields:{}}}),t("struct",{Struct:{fields:{fields:{keyType:"string",type:"Value",id:1}}},Value:{oneofs:{kind:{oneof:["nullValue","numberValue","stringValue","boolValue","structValue","listValue"]}},fields:{nullValue:{type:"NullValue",id:1},numberValue:{type:"double",id:2},stringValue:{type:"string",id:3},boolValue:{type:"bool",id:4},structValue:{type:"Struct",id:5},listValue:{type:"ListValue",id:6}}},NullValue:{values:{NULL_VALUE:0}},ListValue:{fields:{values:{rule:"repeated",type:"Value",id:1}}}}),t("wrappers",{DoubleValue:{fields:{value:{type:"double",id:1}}},FloatValue:{fields:{value:{type:"float",id:1}}},Int64Value:{fields:{value:{type:"int64",id:1}}},UInt64Value:{fields:{value:{type:"uint64",id:1}}},Int32Value:{fields:{value:{type:"int32",id:1}}},UInt32Value:{fields:{value:{type:"uint32",id:1}}},BoolValue:{fields:{value:{type:"bool",id:1}}},StringValue:{fields:{value:{type:"string",id:1}}},BytesValue:{fields:{value:{type:"bytes",id:1}}}}),t("field_mask",{FieldMask:{fields:{paths:{rule:"repeated",type:"string",id:1}}}}),t.get=function(e){return t[e]||null};
        },{}],"Xb+b":[function(require,module,exports) {
            "use strict";var e=module.exports=require("./index-light");e.build="full",e.tokenize=require("./tokenize"),e.parse=require("./parse"),e.common=require("./common"),e.Root._configure(e.Type,e.parse,e.common);
        },{"./index-light":"wgyk","./tokenize":"BwgP","./parse":"9lF6","./common":"A41Z"}],"fN30":[function(require,module,exports) {
            "use strict";module.exports=require("./src/index");
        },{"./src/index":"Xb+b"}],"IK+g":[function(require,module,exports) {
            var global = arguments[3];
            var r=arguments[3];r.crypto&&r.crypto.getRandomValues?module.exports.randomBytes=function(o){var t=new Uint8Array(o);return r.crypto.getRandomValues(t),t}:module.exports.randomBytes=function(r){for(var o=new Array(r),t=0;t<r;t++)o[t]=Math.floor(256*Math.random());return o};
        },{}],"kvjH":[function(require,module,exports) {
            "use strict";var r=require("crypto"),n="abcdefghijklmnopqrstuvwxyz012345";module.exports={string:function(t){for(var e=n.length,u=r.randomBytes(t),o=[],i=0;i<t;i++)o.push(n.substr(u[i]%e,1));return o.join("")},number:function(r){return Math.floor(Math.random()*r)},numberString:function(r){var n=(""+(r-1)).length;return(new Array(n+1).join("0")+this.number(r)).slice(-n)}};
        },{"crypto":"IK+g"}],"q8Q2":[function(require,module,exports) {
            var global = arguments[3];
            var e=arguments[3],t=require("./random"),n={},a=!1,o=e.chrome&&e.chrome.app&&e.chrome.app.runtime;module.exports={attachEvent:function(t,n){void 0!==e.addEventListener?e.addEventListener(t,n,!1):e.document&&e.attachEvent&&(e.document.attachEvent("on"+t,n),e.attachEvent("on"+t,n))},detachEvent:function(t,n){void 0!==e.addEventListener?e.removeEventListener(t,n,!1):e.document&&e.detachEvent&&(e.document.detachEvent("on"+t,n),e.detachEvent("on"+t,n))},unloadAdd:function(e){if(o)return null;var r=t.string(8);return n[r]=e,a&&setTimeout(this.triggerUnloadCallbacks,0),r},unloadDel:function(e){e in n&&delete n[e]},triggerUnloadCallbacks:function(){for(var e in n)n[e](),delete n[e]}};var r=function(){a||(a=!0,module.exports.triggerUnloadCallbacks())};o||module.exports.attachEvent("unload",r);
        },{"./random":"kvjH"}],"qggR":[function(require,module,exports) {
            "use strict";module.exports=function(e,t){if(t=t.split(":")[0],!(e=+e))return!1;switch(t){case"http":case"ws":return 80!==e;case"https":case"wss":return 443!==e;case"ftp":return 21!==e;case"gopher":return 70!==e;case"file":return!1}return 0!==e};
        },{}],"o5xf":[function(require,module,exports) {
            "use strict";var n,e=Object.prototype.hasOwnProperty;function t(n){try{return decodeURIComponent(n.replace(/\+/g," "))}catch(e){return null}}function r(n){try{return encodeURIComponent(n)}catch(e){return null}}function o(n){for(var e,r=/([^=?&]+)=?([^&]*)/g,o={};e=r.exec(n);){var u=t(e[1]),c=t(e[2]);null===u||null===c||u in o||(o[u]=c)}return o}function u(t,r){r=r||"";var o,u,c=[];for(u in"string"!=typeof r&&(r="?"),t)if(e.call(t,u)){if((o=t[u])||null!==o&&o!==n&&!isNaN(o)||(o=""),u=encodeURIComponent(u),o=encodeURIComponent(o),null===u||null===o)continue;c.push(u+"="+o)}return c.length?r+c.join("&"):""}exports.stringify=u,exports.parse=o;
        },{}],"WxRL":[function(require,module,exports) {
            var global = arguments[3];
            var e=arguments[3],o=require("requires-port"),t=require("querystringify"),s=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\S\s]*)/i,r=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,a=[["#","hash"],["?","query"],function(e){return e.replace("\\","/")},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d+)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],n={hash:1,query:1};function i(o){var t,s=("undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:{}).location||{},a={},i=typeof(o=o||s);if("blob:"===o.protocol)a=new l(unescape(o.pathname),{});else if("string"===i)for(t in a=new l(o,{}),n)delete a[t];else if("object"===i){for(t in o)t in n||(a[t]=o[t]);void 0===a.slashes&&(a.slashes=r.test(o.href))}return a}function h(e){var o=s.exec(e);return{protocol:o[1]?o[1].toLowerCase():"",slashes:!!o[2],rest:o[3]}}function p(e,o){for(var t=(o||"/").split("/").slice(0,-1).concat(e.split("/")),s=t.length,r=t[s-1],a=!1,n=0;s--;)"."===t[s]?t.splice(s,1):".."===t[s]?(t.splice(s,1),n++):n&&(0===s&&(a=!0),t.splice(s,1),n--);return a&&t.unshift(""),"."!==r&&".."!==r||t.push(""),t.join("/")}function l(e,s,r){if(!(this instanceof l))return new l(e,s,r);var n,c,u,f,m,y,d=a.slice(),g=typeof s,v=this,w=0;for("object"!==g&&"string"!==g&&(r=s,s=null),r&&"function"!=typeof r&&(r=t.parse),s=i(s),n=!(c=h(e||"")).protocol&&!c.slashes,v.slashes=c.slashes||n&&s.slashes,v.protocol=c.protocol||s.protocol||"",e=c.rest,c.slashes||(d[3]=[/(.*)/,"pathname"]);w<d.length;w++)"function"!=typeof(f=d[w])?(u=f[0],y=f[1],u!=u?v[y]=e:"string"==typeof u?~(m=e.indexOf(u))&&("number"==typeof f[2]?(v[y]=e.slice(0,m),e=e.slice(m+f[2])):(v[y]=e.slice(m),e=e.slice(0,m))):(m=u.exec(e))&&(v[y]=m[1],e=e.slice(0,m.index)),v[y]=v[y]||n&&f[3]&&s[y]||"",f[4]&&(v[y]=v[y].toLowerCase())):e=f(e);r&&(v.query=r(v.query)),n&&s.slashes&&"/"!==v.pathname.charAt(0)&&(""!==v.pathname||""!==s.pathname)&&(v.pathname=p(v.pathname,s.pathname)),o(v.port,v.protocol)||(v.host=v.hostname,v.port=""),v.username=v.password="",v.auth&&(f=v.auth.split(":"),v.username=f[0]||"",v.password=f[1]||""),v.origin=v.protocol&&v.host&&"file:"!==v.protocol?v.protocol+"//"+v.host:"null",v.href=v.toString()}function c(e,s,r){var n=this;switch(e){case"query":"string"==typeof s&&s.length&&(s=(r||t.parse)(s)),n[e]=s;break;case"port":n[e]=s,o(s,n.protocol)?s&&(n.host=n.hostname+":"+s):(n.host=n.hostname,n[e]="");break;case"hostname":n[e]=s,n.port&&(s+=":"+n.port),n.host=s;break;case"host":n[e]=s,/:\d+$/.test(s)?(s=s.split(":"),n.port=s.pop(),n.hostname=s.join(":")):(n.hostname=s,n.port="");break;case"protocol":n.protocol=s.toLowerCase(),n.slashes=!r;break;case"pathname":case"hash":if(s){var i="pathname"===e?"/":"#";n[e]=s.charAt(0)!==i?i+s:s}else n[e]=s;break;default:n[e]=s}for(var h=0;h<a.length;h++){var p=a[h];p[4]&&(n[p[1]]=n[p[1]].toLowerCase())}return n.origin=n.protocol&&n.host&&"file:"!==n.protocol?n.protocol+"//"+n.host:"null",n.href=n.toString(),n}function u(e){e&&"function"==typeof e||(e=t.stringify);var o,s=this,r=s.protocol;r&&":"!==r.charAt(r.length-1)&&(r+=":");var a=r+(s.slashes?"//":"");return s.username&&(a+=s.username,s.password&&(a+=":"+s.password),a+="@"),a+=s.host+s.pathname,(o="object"==typeof s.query?e(s.query):s.query)&&(a+="?"!==o.charAt(0)?"?"+o:o),s.hash&&(a+=s.hash),a}l.prototype={set:c,toString:u},l.extractProtocol=h,l.location=i,l.qs=t,module.exports=l;
        },{"requires-port":"qggR","querystringify":"o5xf"}],"prkv":[function(require,module,exports) {
            "use strict";var r=require("url-parse"),t=function(){};module.exports={getOrigin:function(t){if(!t)return null;var n=new r(t);if("file:"===n.protocol)return null;var i=n.port;return i||(i="https:"===n.protocol?"443":"80"),n.protocol+"//"+n.hostname+":"+i},isOriginEqual:function(r,n){var i=this.getOrigin(r)===this.getOrigin(n);return t("same",r,n,i),i},isSchemeEqual:function(r,t){return r.split(":")[0]===t.split(":")[0]},addPath:function(r,t){var n=r.split("?");return n[0]+t+(n[1]?"?"+n[1]:"")},addQuery:function(r,t){return r+(-1===r.indexOf("?")?"?"+t:"&"+t)}};
        },{"url-parse":"WxRL"}],"oxw+":[function(require,module,exports) {
            "function"==typeof Object.create?module.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:module.exports=function(t,e){t.super_=e;var o=function(){};o.prototype=e.prototype,t.prototype=new o,t.prototype.constructor=t};
        },{}],"PUqX":[function(require,module,exports) {
            "use strict";function t(){this._listeners={}}t.prototype.addEventListener=function(t,e){t in this._listeners||(this._listeners[t]=[]);var s=this._listeners[t];-1===s.indexOf(e)&&(s=s.concat([e])),this._listeners[t]=s},t.prototype.removeEventListener=function(t,e){var s=this._listeners[t];if(s){var i=s.indexOf(e);-1===i||(s.length>1?this._listeners[t]=s.slice(0,i).concat(s.slice(i+1)):delete this._listeners[t])}},t.prototype.dispatchEvent=function(){var t=arguments[0],e=t.type,s=1===arguments.length?[t]:Array.apply(null,arguments);if(this["on"+e]&&this["on"+e].apply(this,s),e in this._listeners)for(var i=this._listeners[e],n=0;n<i.length;n++)i[n].apply(this,s)},module.exports=t;
        },{}],"6GPx":[function(require,module,exports) {
            "use strict";var e=require("inherits"),t=require("./eventtarget");function r(){t.call(this)}e(r,t),r.prototype.removeAllListeners=function(e){e?delete this._listeners[e]:this._listeners={}},r.prototype.once=function(e,t){var r=this,o=!1;this.on(e,function i(){r.removeListener(e,i),o||(o=!0,t.apply(this,arguments))})},r.prototype.emit=function(){var e=arguments[0],t=this._listeners[e];if(t){for(var r=arguments.length,o=new Array(r-1),i=1;i<r;i++)o[i-1]=arguments[i];for(var n=0;n<t.length;n++)t[n].apply(this,o)}},r.prototype.on=r.prototype.addListener=t.prototype.addEventListener,r.prototype.removeListener=t.prototype.removeEventListener,module.exports.EventEmitter=r;
        },{"inherits":"oxw+","./eventtarget":"PUqX"}],"xNcg":[function(require,module,exports) {
            var global = arguments[3];
            var e=arguments[3],o=e.WebSocket||e.MozWebSocket;module.exports=o?function(e){return new o(e)}:void 0;
        },{}],"c80l":[function(require,module,exports) {
            "use strict";var e=require("../utils/event"),s=require("../utils/url"),t=require("inherits"),n=require("events").EventEmitter,o=require("./driver/websocket"),r=function(){};function i(t,l,c){if(!i.enabled())throw new Error("Transport created when disabled");n.call(this),r("constructor",t);var u=this,a=s.addPath(t,"/websocket");a="https"===a.slice(0,5)?"wss"+a.slice(5):"ws"+a.slice(4),this.url=a,this.ws=new o(this.url,[],c),this.ws.onmessage=function(e){r("message event",e.data),u.emit("message",e.data)},this.unloadRef=e.unloadAdd(function(){r("unload"),u.ws.close()}),this.ws.onclose=function(e){r("close event",e.code,e.reason),u.emit("close",e.code,e.reason),u._cleanup()},this.ws.onerror=function(e){r("error event",e),u.emit("close",1006,"WebSocket connection broken"),u._cleanup()}}t(i,n),i.prototype.send=function(e){var s="["+e+"]";r("send",s),this.ws.send(s)},i.prototype.close=function(){r("close");var e=this.ws;this._cleanup(),e&&e.close()},i.prototype._cleanup=function(){r("_cleanup");var s=this.ws;s&&(s.onmessage=s.onclose=s.onerror=null),e.unloadDel(this.unloadRef),this.unloadRef=this.ws=null,this.removeAllListeners()},i.enabled=function(){return r("enabled"),!!o},i.transportName="websocket",i.roundTrips=2,module.exports=i;
        },{"../utils/event":"q8Q2","../utils/url":"prkv","inherits":"oxw+","events":"6GPx","./driver/websocket":"xNcg"}],"o1fQ":[function(require,module,exports) {
            "use strict";var e=require("inherits"),t=require("events").EventEmitter,n=function(){};function s(e,s){n(e),t.call(this),this.sendBuffer=[],this.sender=s,this.url=e}e(s,t),s.prototype.send=function(e){n("send",e),this.sendBuffer.push(e),this.sendStop||this.sendSchedule()},s.prototype.sendScheduleWait=function(){n("sendScheduleWait");var e,t=this;this.sendStop=function(){n("sendStop"),t.sendStop=null,clearTimeout(e)},e=setTimeout(function(){n("timeout"),t.sendStop=null,t.sendSchedule()},25)},s.prototype.sendSchedule=function(){n("sendSchedule",this.sendBuffer.length);var e=this;if(this.sendBuffer.length>0){var t="["+this.sendBuffer.join(",")+"]";this.sendStop=this.sender(this.url,t,function(t){e.sendStop=null,t?(n("error",t),e.emit("close",t.code||1006,"Sending error: "+t),e.close()):e.sendScheduleWait()}),this.sendBuffer=[]}},s.prototype._cleanup=function(){n("_cleanup"),this.removeAllListeners()},s.prototype.close=function(){n("close"),this._cleanup(),this.sendStop&&(this.sendStop(),this.sendStop=null)},module.exports=s;
        },{"inherits":"oxw+","events":"6GPx"}],"4XFA":[function(require,module,exports) {
            "use strict";var e=require("inherits"),s=require("events").EventEmitter,t=function(){};function i(e,i,l){t(i),s.call(this),this.Receiver=e,this.receiveUrl=i,this.AjaxObject=l,this._scheduleReceiver()}e(i,s),i.prototype._scheduleReceiver=function(){t("_scheduleReceiver");var e=this,s=this.poll=new this.Receiver(this.receiveUrl,this.AjaxObject);s.on("message",function(s){t("message",s),e.emit("message",s)}),s.once("close",function(i,l){t("close",i,l,e.pollIsClosing),e.poll=s=null,e.pollIsClosing||("network"===l?e._scheduleReceiver():(e.emit("close",i||1006,l),e.removeAllListeners()))})},i.prototype.abort=function(){t("abort"),this.removeAllListeners(),this.pollIsClosing=!0,this.poll&&this.poll.abort()},module.exports=i;
        },{"inherits":"oxw+","events":"6GPx"}],"sju2":[function(require,module,exports) {
            "use strict";var l=require("inherits"),e=require("../../utils/url"),o=require("./buffered-sender"),s=require("./polling"),t=function(){};function i(l,i,r,n,c){var u=e.addPath(l,i);t(u);var p=this;o.call(this,l,r),this.poll=new s(n,u,c),this.poll.on("message",function(l){t("poll message",l),p.emit("message",l)}),this.poll.once("close",function(l,e){t("poll close",l,e),p.poll=null,p.emit("close",l,e),p.close()})}l(i,o),i.prototype.close=function(){o.prototype.close.call(this),t("close"),this.removeAllListeners(),this.poll&&(this.poll.abort(),this.poll=null)},module.exports=i;
        },{"inherits":"oxw+","../../utils/url":"prkv","./buffered-sender":"o1fQ","./polling":"4XFA"}],"h4sR":[function(require,module,exports) {
            "use strict";var e=require("inherits"),r=require("../../utils/url"),n=require("./sender-receiver"),t=function(){};function i(e){return function(n,i,u){t("create ajax sender",n,i);var o={};"string"==typeof i&&(o.headers={"Content-type":"text/plain"});var s=r.addPath(n,"/xhr_send"),a=new e("POST",s,i,o);return a.once("finish",function(e){if(t("finish",e),a=null,200!==e&&204!==e)return u(new Error("http status "+e));u()}),function(){t("abort"),a.close(),a=null;var e=new Error("Aborted");e.code=1e3,u(e)}}}function u(e,r,t,u){n.call(this,e,r,i(u),t,u)}e(u,n),module.exports=u;
        },{"inherits":"oxw+","../../utils/url":"prkv","./sender-receiver":"sju2"}],"kyBw":[function(require,module,exports) {
            "use strict";var e=require("inherits"),i=require("events").EventEmitter,n=function(){};function t(e,t){n(e),i.call(this);var s=this;this.bufferPosition=0,this.xo=new t("POST",e,null),this.xo.on("chunk",this._chunkHandler.bind(this)),this.xo.once("finish",function(e,i){n("finish",e,i),s._chunkHandler(e,i),s.xo=null;var t=200===e?"network":"permanent";n("close",t),s.emit("close",null,t),s._cleanup()})}e(t,i),t.prototype._chunkHandler=function(e,i){if(n("_chunkHandler",e),200===e&&i)for(var t=-1;;this.bufferPosition+=t+1){var s=i.slice(this.bufferPosition);if(-1===(t=s.indexOf("\n")))break;var o=s.slice(0,t);o&&(n("message",o),this.emit("message",o))}},t.prototype._cleanup=function(){n("_cleanup"),this.removeAllListeners()},t.prototype.abort=function(){n("abort"),this.xo&&(this.xo.close(),n("close"),this.emit("close",null,"user"),this.xo=null),this._cleanup()},module.exports=t;
        },{"inherits":"oxw+","events":"6GPx"}],"TbCi":[function(require,module,exports) {
            var global = arguments[3];
            var t=arguments[3],e=require("events").EventEmitter,i=require("inherits"),n=require("../../utils/event"),r=require("../../utils/url"),s=t.XMLHttpRequest,h=function(){};function a(t,i,n,r){h(t,i);var s=this;e.call(this),setTimeout(function(){s._start(t,i,n,r)},0)}i(a,e),a.prototype._start=function(t,e,i,u){var o=this;try{this.xhr=new s}catch(l){}if(!this.xhr)return h("no xhr"),this.emit("finish",0,"no xhr support"),void this._cleanup();e=r.addQuery(e,"t="+ +new Date),this.unloadRef=n.unloadAdd(function(){h("unload cleanup"),o._cleanup(!0)});try{this.xhr.open(t,e,!0),this.timeout&&"timeout"in this.xhr&&(this.xhr.timeout=this.timeout,this.xhr.ontimeout=function(){h("xhr timeout"),o.emit("finish",0,""),o._cleanup(!1)})}catch(d){return h("exception",d),this.emit("finish",0,""),void this._cleanup(!1)}if(u&&u.noCredentials||!a.supportsCORS||(h("withCredentials"),this.xhr.withCredentials=!0),u&&u.headers)for(var c in u.headers)this.xhr.setRequestHeader(c,u.headers[c]);this.xhr.onreadystatechange=function(){if(o.xhr){var t,e,i=o.xhr;switch(h("readyState",i.readyState),i.readyState){case 3:try{e=i.status,t=i.responseText}catch(d){}h("status",e),1223===e&&(e=204),200===e&&t&&t.length>0&&(h("chunk"),o.emit("chunk",e,t));break;case 4:e=i.status,h("status",e),1223===e&&(e=204),12005!==e&&12029!==e||(e=0),h("finish",e,i.responseText),o.emit("finish",e,i.responseText),o._cleanup(!1)}}};try{o.xhr.send(i)}catch(d){o.emit("finish",0,""),o._cleanup(!1)}},a.prototype._cleanup=function(t){if(h("cleanup"),this.xhr){if(this.removeAllListeners(),n.unloadDel(this.unloadRef),this.xhr.onreadystatechange=function(){},this.xhr.ontimeout&&(this.xhr.ontimeout=null),t)try{this.xhr.abort()}catch(e){}this.unloadRef=this.xhr=null}},a.prototype.close=function(){h("close"),this._cleanup(!0)},a.enabled=!!s;var u=["Active"].concat("Object").join("X");!a.enabled&&u in t&&(h("overriding xmlhttprequest"),s=function(){try{return new t[u]("Microsoft.XMLHTTP")}catch(e){return null}},a.enabled=!!new s);var o=!1;try{o="withCredentials"in new s}catch(c){}a.supportsCORS=o,module.exports=a;
        },{"events":"6GPx","inherits":"oxw+","../../utils/event":"q8Q2","../../utils/url":"prkv"}],"TBnt":[function(require,module,exports) {
            "use strict";var e=require("inherits"),r=require("../driver/xhr");function i(e,i,s,t){r.call(this,e,i,s,t)}e(i,r),i.enabled=r.enabled&&r.supportsCORS,module.exports=i;
        },{"inherits":"oxw+","../driver/xhr":"TbCi"}],"9mX/":[function(require,module,exports) {
            "use strict";var e=require("inherits"),r=require("../driver/xhr");function i(e,i,n){r.call(this,e,i,n,{noCredentials:!0})}e(i,r),i.enabled=r.enabled,module.exports=i;
        },{"inherits":"oxw+","../driver/xhr":"TbCi"}],"+JeF":[function(require,module,exports) {
            var global = arguments[3];
            var r=arguments[3];module.exports={isOpera:function(){return r.navigator&&/opera/i.test(r.navigator.userAgent)},isKonqueror:function(){return r.navigator&&/konqueror/i.test(r.navigator.userAgent)},hasDomain:function(){if(!r.document)return!0;try{return!!r.document.domain}catch(n){return!1}}};
        },{}],"a/LL":[function(require,module,exports) {
            var global = arguments[3];
            var e=arguments[3],r=require("inherits"),n=require("./lib/ajax-based"),i=require("./receiver/xhr"),a=require("./sender/xhr-cors"),s=require("./sender/xhr-local"),t=require("../utils/browser");function d(e){if(!s.enabled&&!a.enabled)throw new Error("Transport created when disabled");n.call(this,e,"/xhr_streaming",i,a)}r(d,n),d.enabled=function(e){return!e.nullOrigin&&(!t.isOpera()&&a.enabled)},d.transportName="xhr-streaming",d.roundTrips=2,d.needBody=!!e.document,module.exports=d;
        },{"inherits":"oxw+","./lib/ajax-based":"h4sR","./receiver/xhr":"kyBw","./sender/xhr-cors":"TBnt","./sender/xhr-local":"9mX/","../utils/browser":"+JeF"}],"VmyL":[function(require,module,exports) {
            var global = arguments[3];
            var t=arguments[3],e=require("events").EventEmitter,r=require("inherits"),o=require("../../utils/event"),i=require("../../utils/browser"),n=require("../../utils/url"),s=function(){};function u(t,r,o){s(t,r);var i=this;e.call(this),setTimeout(function(){i._start(t,r,o)},0)}r(u,e),u.prototype._start=function(e,r,i){s("_start");var u=this,a=new t.XDomainRequest;r=n.addQuery(r,"t="+ +new Date),a.onerror=function(){s("onerror"),u._error()},a.ontimeout=function(){s("ontimeout"),u._error()},a.onprogress=function(){s("progress",a.responseText),u.emit("chunk",200,a.responseText)},a.onload=function(){s("load"),u.emit("finish",200,a.responseText),u._cleanup(!1)},this.xdr=a,this.unloadRef=o.unloadAdd(function(){u._cleanup(!0)});try{this.xdr.open(e,r),this.timeout&&(this.xdr.timeout=this.timeout),this.xdr.send(i)}catch(h){this._error()}},u.prototype._error=function(){this.emit("finish",0,""),this._cleanup(!1)},u.prototype._cleanup=function(t){if(s("cleanup",t),this.xdr){if(this.removeAllListeners(),o.unloadDel(this.unloadRef),this.xdr.ontimeout=this.xdr.onerror=this.xdr.onprogress=this.xdr.onload=null,t)try{this.xdr.abort()}catch(e){}this.unloadRef=this.xdr=null}},u.prototype.close=function(){s("close"),this._cleanup(!0)},u.enabled=!(!t.XDomainRequest||!i.hasDomain()),module.exports=u;
        },{"events":"6GPx","inherits":"oxw+","../../utils/event":"q8Q2","../../utils/browser":"+JeF","../../utils/url":"prkv"}],"UfBN":[function(require,module,exports) {
            "use strict";var e=require("inherits"),r=require("./lib/ajax-based"),i=require("./receiver/xhr"),n=require("./sender/xdr");function a(e){if(!n.enabled)throw new Error("Transport created when disabled");r.call(this,e,"/xhr_streaming",i,n)}e(a,r),a.enabled=function(e){return!e.cookie_needed&&!e.nullOrigin&&(n.enabled&&e.sameScheme)},a.transportName="xdr-streaming",a.roundTrips=2,module.exports=a;
        },{"inherits":"oxw+","./lib/ajax-based":"h4sR","./receiver/xhr":"kyBw","./sender/xdr":"VmyL"}],"YxpD":[function(require,module,exports) {
            var global = arguments[3];
            var e=arguments[3];module.exports=e.EventSource;
        },{}],"pVdQ":[function(require,module,exports) {
            "use strict";var e=require("inherits"),t=require("events").EventEmitter,r=require("eventsource"),n=function(){};function o(e){n(e),t.call(this);var o=this,s=this.es=new r(e);s.onmessage=function(e){n("message",e.data),o.emit("message",decodeURI(e.data))},s.onerror=function(e){n("error",s.readyState,e);var t=2!==s.readyState?"network":"permanent";o._cleanup(),o._close(t)}}e(o,t),o.prototype.abort=function(){n("abort"),this._cleanup(),this._close("user")},o.prototype._cleanup=function(){n("cleanup");var e=this.es;e&&(e.onmessage=e.onerror=null,e.close(),this.es=null)},o.prototype._close=function(e){n("close",e);var t=this;setTimeout(function(){t.emit("close",null,e),t.removeAllListeners()},200)},module.exports=o;
        },{"inherits":"oxw+","events":"6GPx","eventsource":"YxpD"}],"DuLI":[function(require,module,exports) {
            "use strict";var e=require("inherits"),r=require("./lib/ajax-based"),n=require("./receiver/eventsource"),t=require("./sender/xhr-cors"),i=require("eventsource");function s(e){if(!s.enabled())throw new Error("Transport created when disabled");r.call(this,e,"/eventsource",n,t)}e(s,r),s.enabled=function(){return!!i},s.transportName="eventsource",s.roundTrips=2,module.exports=s;
        },{"inherits":"oxw+","./lib/ajax-based":"h4sR","./receiver/eventsource":"pVdQ","./sender/xhr-cors":"TBnt","eventsource":"YxpD"}],"r5wZ":[function(require,module,exports) {
            var define;
            var global = arguments[3];
            var t,e=arguments[3];(function(){var r="function"==typeof t&&t.amd,n={function:!0,object:!0},o=n[typeof exports]&&exports&&!exports.nodeType&&exports,c=n[typeof window]&&window||this,i=o&&n[typeof module]&&module&&!module.nodeType&&"object"==typeof e&&e;function a(t,e){t||(t=c.Object()),e||(e=c.Object());var r=t.Number||c.Number,o=t.String||c.String,i=t.Object||c.Object,l=t.Date||c.Date,f=t.SyntaxError||c.SyntaxError,u=t.TypeError||c.TypeError,s=t.Math||c.Math,h=t.JSON||c.JSON;"object"==typeof h&&h&&(e.stringify=h.stringify,e.parse=h.parse);var p,g,y,b=i.prototype,j=b.toString,d=new l(-0xc782b5b800cec);try{d=-109252==d.getUTCFullYear()&&0===d.getUTCMonth()&&1===d.getUTCDate()&&10==d.getUTCHours()&&37==d.getUTCMinutes()&&6==d.getUTCSeconds()&&708==d.getUTCMilliseconds()}catch(P){}function v(t){if(v[t]!==y)return v[t];var n;if("bug-string-char-index"==t)n="a"!="a"[0];else if("json"==t)n=v("json-stringify")&&v("json-parse");else{var c,i='{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}';if("json-stringify"==t){var a=e.stringify,f="function"==typeof a&&d;if(f){(c=function(){return 1}).toJSON=c;try{f="0"===a(0)&&"0"===a(new r)&&'""'==a(new o)&&a(j)===y&&a(y)===y&&a()===y&&"1"===a(c)&&"[1]"==a([c])&&"[null]"==a([y])&&"null"==a(null)&&"[null,null,null]"==a([y,j,null])&&a({a:[c,!0,!1,null,"\0\b\n\f\r\t"]})==i&&"1"===a(null,c)&&"[\n 1,\n 2\n]"==a([1,2],null,1)&&'"-271821-04-20T00:00:00.000Z"'==a(new l(-864e13))&&'"+275760-09-13T00:00:00.000Z"'==a(new l(864e13))&&'"-000001-01-01T00:00:00.000Z"'==a(new l(-621987552e5))&&'"1969-12-31T23:59:59.999Z"'==a(new l(-1))}catch(P){f=!1}}n=f}if("json-parse"==t){var u=e.parse;if("function"==typeof u)try{if(0===u("0")&&!u(!1)){var s=5==(c=u(i)).a.length&&1===c.a[0];if(s){try{s=!u('"\t"')}catch(P){}if(s)try{s=1!==u("01")}catch(P){}if(s)try{s=1!==u("1.")}catch(P){}}}}catch(P){s=!1}n=s}}return v[t]=!!n}if(!v("json")){var C=v("bug-string-char-index");if(!d)var S=s.floor,O=[0,31,59,90,120,151,181,212,243,273,304,334],A=function(t,e){return O[e]+365*(t-1970)+S((t-1969+(e=+(e>1)))/4)-S((t-1901+e)/100)+S((t-1601+e)/400)};if((p=b.hasOwnProperty)||(p=function(t){var e,r={};return(r.__proto__=null,r.__proto__={toString:1},r).toString!=j?p=function(t){var e=this.__proto__,r=t in(this.__proto__=null,this);return this.__proto__=e,r}:(e=r.constructor,p=function(t){var r=(this.constructor||e).prototype;return t in this&&!(t in r&&this[t]===r[t])}),r=null,p.call(this,t)}),g=function(t,e){var r,o,c,i=0;for(c in(r=function(){this.valueOf=0}).prototype.valueOf=0,o=new r)p.call(o,c)&&i++;return r=o=null,i?g=2==i?function(t,e){var r,n={},o="[object Function]"==j.call(t);for(r in t)o&&"prototype"==r||p.call(n,r)||!(n[r]=1)||!p.call(t,r)||e(r)}:function(t,e){var r,n,o="[object Function]"==j.call(t);for(r in t)o&&"prototype"==r||!p.call(t,r)||(n="constructor"===r)||e(r);(n||p.call(t,r="constructor"))&&e(r)}:(o=["valueOf","toString","toLocaleString","propertyIsEnumerable","isPrototypeOf","hasOwnProperty","constructor"],g=function(t,e){var r,c,i="[object Function]"==j.call(t),a=!i&&"function"!=typeof t.constructor&&n[typeof t.hasOwnProperty]&&t.hasOwnProperty||p;for(r in t)i&&"prototype"==r||!a.call(t,r)||e(r);for(c=o.length;r=o[--c];a.call(t,r)&&e(r));}),g(t,e)},!v("json-stringify")){var w={92:"\\\\",34:'\\"',8:"\\b",12:"\\f",10:"\\n",13:"\\r",9:"\\t"},T=function(t,e){return("000000"+(e||0)).slice(-t)},_=function(t){for(var e='"',r=0,n=t.length,o=!C||n>10,c=o&&(C?t.split(""):t);r<n;r++){var i=t.charCodeAt(r);switch(i){case 8:case 9:case 10:case 12:case 13:case 34:case 92:e+=w[i];break;default:if(i<32){e+="\\u00"+T(2,i.toString(16));break}e+=o?c[r]:t.charAt(r)}}return e+'"'},N=function(t,e,r,n,o,c,i){var a,l,f,s,h,b,d,v,C,O,w,U,m,J,x,M;try{a=e[t]}catch(P){}if("object"==typeof a&&a)if("[object Date]"!=(l=j.call(a))||p.call(a,"toJSON"))"function"==typeof a.toJSON&&("[object Number]"!=l&&"[object String]"!=l&&"[object Array]"!=l||p.call(a,"toJSON"))&&(a=a.toJSON(t));else if(a>-1/0&&a<1/0){if(A){for(h=S(a/864e5),f=S(h/365.2425)+1970-1;A(f+1,0)<=h;f++);for(s=S((h-A(f,0))/30.42);A(f,s+1)<=h;s++);h=1+h-A(f,s),d=S((b=(a%864e5+864e5)%864e5)/36e5)%24,v=S(b/6e4)%60,C=S(b/1e3)%60,O=b%1e3}else f=a.getUTCFullYear(),s=a.getUTCMonth(),h=a.getUTCDate(),d=a.getUTCHours(),v=a.getUTCMinutes(),C=a.getUTCSeconds(),O=a.getUTCMilliseconds();a=(f<=0||f>=1e4?(f<0?"-":"+")+T(6,f<0?-f:f):T(4,f))+"-"+T(2,s+1)+"-"+T(2,h)+"T"+T(2,d)+":"+T(2,v)+":"+T(2,C)+"."+T(3,O)+"Z"}else a=null;if(r&&(a=r.call(e,t,a)),null===a)return"null";if("[object Boolean]"==(l=j.call(a)))return""+a;if("[object Number]"==l)return a>-1/0&&a<1/0?""+a:"null";if("[object String]"==l)return _(""+a);if("object"==typeof a){for(J=i.length;J--;)if(i[J]===a)throw u();if(i.push(a),w=[],x=c,c+=o,"[object Array]"==l){for(m=0,J=a.length;m<J;m++)U=N(m,a,r,n,o,c,i),w.push(U===y?"null":U);M=w.length?o?"[\n"+c+w.join(",\n"+c)+"\n"+x+"]":"["+w.join(",")+"]":"[]"}else g(n||a,function(t){var e=N(t,a,r,n,o,c,i);e!==y&&w.push(_(t)+":"+(o?" ":"")+e)}),M=w.length?o?"{\n"+c+w.join(",\n"+c)+"\n"+x+"}":"{"+w.join(",")+"}":"{}";return i.pop(),M}};e.stringify=function(t,e,r){var o,c,i,a;if(n[typeof e]&&e)if("[object Function]"==(a=j.call(e)))c=e;else if("[object Array]"==a){i={};for(var l,f=0,u=e.length;f<u;l=e[f++],("[object String]"==(a=j.call(l))||"[object Number]"==a)&&(i[l]=1));}if(r)if("[object Number]"==(a=j.call(r))){if((r-=r%1)>0)for(o="",r>10&&(r=10);o.length<r;o+=" ");}else"[object String]"==a&&(o=r.length<=10?r:r.slice(0,10));return N("",((l={})[""]=t,l),c,i,o,"",[])}}if(!v("json-parse")){var U,m,J=o.fromCharCode,x={92:"\\",34:'"',47:"/",98:"\b",116:"\t",110:"\n",102:"\f",114:"\r"},M=function(){throw U=m=null,f()},F=function(){for(var t,e,r,n,o,c=m,i=c.length;U<i;)switch(o=c.charCodeAt(U)){case 9:case 10:case 13:case 32:U++;break;case 123:case 125:case 91:case 93:case 58:case 44:return t=C?c.charAt(U):c[U],U++,t;case 34:for(t="@",U++;U<i;)if((o=c.charCodeAt(U))<32)M();else if(92==o)switch(o=c.charCodeAt(++U)){case 92:case 34:case 47:case 98:case 116:case 110:case 102:case 114:t+=x[o],U++;break;case 117:for(e=++U,r=U+4;U<r;U++)(o=c.charCodeAt(U))>=48&&o<=57||o>=97&&o<=102||o>=65&&o<=70||M();t+=J("0x"+c.slice(e,U));break;default:M()}else{if(34==o)break;for(o=c.charCodeAt(U),e=U;o>=32&&92!=o&&34!=o;)o=c.charCodeAt(++U);t+=c.slice(e,U)}if(34==c.charCodeAt(U))return U++,t;M();default:if(e=U,45==o&&(n=!0,o=c.charCodeAt(++U)),o>=48&&o<=57){for(48==o&&((o=c.charCodeAt(U+1))>=48&&o<=57)&&M(),n=!1;U<i&&((o=c.charCodeAt(U))>=48&&o<=57);U++);if(46==c.charCodeAt(U)){for(r=++U;r<i&&((o=c.charCodeAt(r))>=48&&o<=57);r++);r==U&&M(),U=r}if(101==(o=c.charCodeAt(U))||69==o){for(43!=(o=c.charCodeAt(++U))&&45!=o||U++,r=U;r<i&&((o=c.charCodeAt(r))>=48&&o<=57);r++);r==U&&M(),U=r}return+c.slice(e,U)}if(n&&M(),"true"==c.slice(U,U+4))return U+=4,!0;if("false"==c.slice(U,U+5))return U+=5,!1;if("null"==c.slice(U,U+4))return U+=4,null;M()}return"$"},k=function(t){var e,r;if("$"==t&&M(),"string"==typeof t){if("@"==(C?t.charAt(0):t[0]))return t.slice(1);if("["==t){for(e=[];"]"!=(t=F());r||(r=!0))r&&(","==t?"]"==(t=F())&&M():M()),","==t&&M(),e.push(k(t));return e}if("{"==t){for(e={};"}"!=(t=F());r||(r=!0))r&&(","==t?"}"==(t=F())&&M():M()),","!=t&&"string"==typeof t&&"@"==(C?t.charAt(0):t[0])&&":"==F()||M(),e[t.slice(1)]=k(F());return e}M()}return t},D=function(t,e,r){var n=E(t,e,r);n===y?delete t[e]:t[e]=n},E=function(t,e,r){var n,o=t[e];if("object"==typeof o&&o)if("[object Array]"==j.call(o))for(n=o.length;n--;)D(o,n,r);else g(o,function(t){D(o,t,r)});return r.call(t,e,o)};e.parse=function(t,e){var r,n;return U=0,m=""+t,r=k(F()),"$"!=F()&&M(),U=m=null,e&&"[object Function]"==j.call(e)?E(((n={})[""]=r,n),"",e):r}}}return e.runInContext=a,e}if(!i||i.global!==i&&i.window!==i&&i.self!==i||(c=i),o&&!r)a(c,o);else{var l=c.JSON,f=c.JSON3,u=!1,s=a(c,c.JSON3={noConflict:function(){return u||(u=!0,c.JSON=l,c.JSON3=f,l=f=null),s}});c.JSON={parse:s.parse,stringify:s.stringify}}r&&t(function(){return s})}).call(this);
        },{}],"A8Oj":[function(require,module,exports) {
            module.exports="1.3.0";
        },{}],"lHOv":[function(require,module,exports) {
            var global = arguments[3];
            var e=arguments[3],o=require("./event"),n=require("json3"),t=require("./browser"),r=function(){};module.exports={WPrefix:"_jp",currentWindowId:null,polluteGlobalNamespace:function(){module.exports.WPrefix in e||(e[module.exports.WPrefix]={})},postMessage:function(o,t){e.parent!==e?e.parent.postMessage(n.stringify({windowId:module.exports.currentWindowId,type:o,data:t||""}),"*"):r("Cannot postMessage, no parent window.",o,t)},createIframe:function(n,t){var i,u,a=e.document.createElement("iframe"),l=function(){r("unattach"),clearTimeout(i);try{a.onload=null}catch(e){}a.onerror=null},c=function(){r("cleanup"),a&&(l(),setTimeout(function(){a&&a.parentNode.removeChild(a),a=null},0),o.unloadDel(u))},d=function(e){r("onerror",e),a&&(c(),t(e))};return a.src=n,a.style.display="none",a.style.position="absolute",a.onerror=function(){d("onerror")},a.onload=function(){r("onload"),clearTimeout(i),i=setTimeout(function(){d("onload timeout")},2e3)},e.document.body.appendChild(a),i=setTimeout(function(){d("timeout")},15e3),u=o.unloadAdd(c),{post:function(e,o){r("post",e,o),setTimeout(function(){try{a&&a.contentWindow&&a.contentWindow.postMessage(e,o)}catch(n){}},0)},cleanup:c,loaded:l}},createHtmlfile:function(n,t){var i,u,a,l=["Active"].concat("Object").join("X"),c=new e[l]("htmlfile"),d=function(){clearTimeout(i),a.onerror=null},s=function(){c&&(d(),o.unloadDel(u),a.parentNode.removeChild(a),a=c=null,CollectGarbage())},p=function(e){r("onerror",e),c&&(s(),t(e))};c.open(),c.write('<html><script>document.domain="'+e.document.domain+'";<\/script></html>'),c.close(),c.parentWindow[module.exports.WPrefix]=e[module.exports.WPrefix];var m=c.createElement("div");return c.body.appendChild(m),a=c.createElement("iframe"),m.appendChild(a),a.src=n,a.onerror=function(){p("onerror")},i=setTimeout(function(){p("timeout")},15e3),u=o.unloadAdd(s),{post:function(e,o){try{setTimeout(function(){a&&a.contentWindow&&a.contentWindow.postMessage(e,o)},0)}catch(n){}},cleanup:s,loaded:d}}},module.exports.iframeEnabled=!1,e.document&&(module.exports.iframeEnabled=("function"==typeof e.postMessage||"object"==typeof e.postMessage)&&!t.isKonqueror());
        },{"./event":"q8Q2","json3":"r5wZ","./browser":"+JeF"}],"B5iP":[function(require,module,exports) {
            "use strict";var e=require("inherits"),i=require("json3"),s=require("events").EventEmitter,t=require("../version"),a=require("../utils/url"),r=require("../utils/iframe"),n=require("../utils/event"),o=require("../utils/random"),h=function(){};function d(e,i,t){if(!d.enabled())throw new Error("Transport created when disabled");s.call(this);var l=this;this.origin=a.getOrigin(t),this.baseUrl=t,this.transUrl=i,this.transport=e,this.windowId=o.string(8);var c=a.addPath(t,"/iframe.html")+"#"+this.windowId;h(e,i,c),this.iframeObj=r.createIframe(c,function(e){h("err callback"),l.emit("close",1006,"Unable to load an iframe ("+e+")"),l.close()}),this.onmessageCallback=this._message.bind(this),n.attachEvent("message",this.onmessageCallback)}e(d,s),d.prototype.close=function(){if(h("close"),this.removeAllListeners(),this.iframeObj){n.detachEvent("message",this.onmessageCallback);try{this.postMessage("c")}catch(e){}this.iframeObj.cleanup(),this.iframeObj=null,this.onmessageCallback=this.iframeObj=null}},d.prototype._message=function(e){if(h("message",e.data),a.isOriginEqual(e.origin,this.origin)){var s;try{s=i.parse(e.data)}catch(n){return void h("bad json",e.data)}if(s.windowId===this.windowId)switch(s.type){case"s":this.iframeObj.loaded(),this.postMessage("s",i.stringify([t,this.transport,this.transUrl,this.baseUrl]));break;case"t":this.emit("message",s.data);break;case"c":var r;try{r=i.parse(s.data)}catch(n){return void h("bad json",s.data)}this.emit("close",r[0],r[1]),this.close()}else h("mismatched window id",s.windowId,this.windowId)}else h("not same origin",e.origin,this.origin)},d.prototype.postMessage=function(e,s){h("postMessage",e,s),this.iframeObj.post(i.stringify({windowId:this.windowId,type:e,data:s||""}),this.origin)},d.prototype.send=function(e){h("send",e),this.postMessage("m",e)},d.enabled=function(){return r.iframeEnabled},d.transportName="iframe",d.roundTrips=2,module.exports=d;
        },{"inherits":"oxw+","json3":"r5wZ","events":"6GPx","../version":"A8Oj","../utils/url":"prkv","../utils/iframe":"lHOv","../utils/event":"q8Q2","../utils/random":"kvjH"}],"ykCA":[function(require,module,exports) {
            "use strict";module.exports={isObject:function(t){var e=typeof t;return"function"===e||"object"===e&&!!t},extend:function(t){if(!this.isObject(t))return t;for(var e,r,n=1,o=arguments.length;n<o;n++)for(r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}};
        },{}],"XHhf":[function(require,module,exports) {
            var global = arguments[3];
            var r=arguments[3],e=require("inherits"),n=require("../iframe"),t=require("../../utils/object");module.exports=function(a){function i(r,e){n.call(this,a.transportName,r,e)}return e(i,n),i.enabled=function(e,i){if(!r.document)return!1;var u=t.extend({},i);return u.sameOrigin=!0,a.enabled(u)&&n.enabled()},i.transportName="iframe-"+a.transportName,i.needBody=!0,i.roundTrips=n.roundTrips+a.roundTrips-1,i.facadeTransport=a,i};
        },{"inherits":"oxw+","../iframe":"B5iP","../../utils/object":"ykCA"}],"4eIr":[function(require,module,exports) {
            var global = arguments[3];
            var e=arguments[3],t=require("inherits"),i=require("../../utils/iframe"),l=require("../../utils/url"),n=require("events").EventEmitter,a=require("../../utils/random"),r=function(){};function s(t){r(t),n.call(this);var o=this;i.polluteGlobalNamespace(),this.id="a"+a.string(6),t=l.addQuery(t,"c="+decodeURIComponent(i.WPrefix+"."+this.id)),r("using htmlfile",s.htmlfileEnabled);var c=s.htmlfileEnabled?i.createHtmlfile:i.createIframe;e[i.WPrefix][this.id]={start:function(){r("start"),o.iframeObj.loaded()},message:function(e){r("message",e),o.emit("message",e)},stop:function(){r("stop"),o._cleanup(),o._close("network")}},this.iframeObj=c(t,function(){r("callback"),o._cleanup(),o._close("permanent")})}t(s,n),s.prototype.abort=function(){r("abort"),this._cleanup(),this._close("user")},s.prototype._cleanup=function(){r("_cleanup"),this.iframeObj&&(this.iframeObj.cleanup(),this.iframeObj=null),delete e[i.WPrefix][this.id]},s.prototype._close=function(e){r("_close",e),this.emit("close",null,e),this.removeAllListeners()},s.htmlfileEnabled=!1;var o=["Active"].concat("Object").join("X");if(o in e)try{s.htmlfileEnabled=!!new e[o]("htmlfile")}catch(c){}s.enabled=s.htmlfileEnabled||i.iframeEnabled,module.exports=s;
        },{"inherits":"oxw+","../../utils/iframe":"lHOv","../../utils/url":"prkv","events":"6GPx","../../utils/random":"kvjH"}],"+TEV":[function(require,module,exports) {
            "use strict";var e=require("inherits"),r=require("./receiver/htmlfile"),i=require("./sender/xhr-local"),l=require("./lib/ajax-based");function n(e){if(!r.enabled)throw new Error("Transport created when disabled");l.call(this,e,"/htmlfile",r,i)}e(n,l),n.enabled=function(e){return r.enabled&&e.sameOrigin},n.transportName="htmlfile",n.roundTrips=2,module.exports=n;
        },{"inherits":"oxw+","./receiver/htmlfile":"4eIr","./sender/xhr-local":"9mX/","./lib/ajax-based":"h4sR"}],"G9AK":[function(require,module,exports) {
            "use strict";var e=require("inherits"),r=require("./lib/ajax-based"),n=require("./receiver/xhr"),i=require("./sender/xhr-cors"),a=require("./sender/xhr-local");function l(e){if(!a.enabled&&!i.enabled)throw new Error("Transport created when disabled");r.call(this,e,"/xhr",n,i)}e(l,r),l.enabled=function(e){return!e.nullOrigin&&(!(!a.enabled||!e.sameOrigin)||i.enabled)},l.transportName="xhr-polling",l.roundTrips=2,module.exports=l;
        },{"inherits":"oxw+","./lib/ajax-based":"h4sR","./receiver/xhr":"kyBw","./sender/xhr-cors":"TBnt","./sender/xhr-local":"9mX/"}],"GwrO":[function(require,module,exports) {
            "use strict";var r=require("inherits"),e=require("./lib/ajax-based"),i=require("./xdr-streaming"),a=require("./receiver/xhr"),n=require("./sender/xdr");function d(r){if(!n.enabled)throw new Error("Transport created when disabled");e.call(this,r,"/xhr",a,n)}r(d,e),d.enabled=i.enabled,d.transportName="xdr-polling",d.roundTrips=2,module.exports=d;
        },{"inherits":"oxw+","./lib/ajax-based":"h4sR","./xdr-streaming":"UfBN","./receiver/xhr":"kyBw","./sender/xdr":"VmyL"}],"nruP":[function(require,module,exports) {
            var global = arguments[3];
            var t=arguments[3],e=require("../../utils/iframe"),r=require("../../utils/random"),i=require("../../utils/browser"),o=require("../../utils/url"),a=require("inherits"),s=require("events").EventEmitter,n=function(){};function c(i){n(i);var a=this;s.call(this),e.polluteGlobalNamespace(),this.id="a"+r.string(6);var l=o.addQuery(i,"c="+encodeURIComponent(e.WPrefix+"."+this.id));t[e.WPrefix][this.id]=this._callback.bind(this),this._createScript(l),this.timeoutId=setTimeout(function(){n("timeout"),a._abort(new Error("JSONP script loaded abnormally (timeout)"))},c.timeout)}a(c,s),c.prototype.abort=function(){if(n("abort"),t[e.WPrefix][this.id]){var r=new Error("JSONP user aborted read");r.code=1e3,this._abort(r)}},c.timeout=35e3,c.scriptErrorTimeout=1e3,c.prototype._callback=function(t){n("_callback",t),this._cleanup(),this.aborting||(t&&(n("message",t),this.emit("message",t)),this.emit("close",null,"network"),this.removeAllListeners())},c.prototype._abort=function(t){n("_abort",t),this._cleanup(),this.aborting=!0,this.emit("close",t.code,t.message),this.removeAllListeners()},c.prototype._cleanup=function(){if(n("_cleanup"),clearTimeout(this.timeoutId),this.script2&&(this.script2.parentNode.removeChild(this.script2),this.script2=null),this.script){var r=this.script;r.parentNode.removeChild(r),r.onreadystatechange=r.onerror=r.onload=r.onclick=null,this.script=null}delete t[e.WPrefix][this.id]},c.prototype._scriptError=function(){n("_scriptError");var t=this;this.errorTimer||(this.errorTimer=setTimeout(function(){t.loadedOkay||t._abort(new Error("JSONP script loaded abnormally (onerror)"))},c.scriptErrorTimeout))},c.prototype._createScript=function(e){n("_createScript",e);var o,a=this,s=this.script=t.document.createElement("script");if(s.id="a"+r.string(8),s.src=e,s.type="text/javascript",s.charset="UTF-8",s.onerror=this._scriptError.bind(this),s.onload=function(){n("onload"),a._abort(new Error("JSONP script loaded abnormally (onload)"))},s.onreadystatechange=function(){if(n("onreadystatechange",s.readyState),/loaded|closed/.test(s.readyState)){if(s&&s.htmlFor&&s.onclick){a.loadedOkay=!0;try{s.onclick()}catch(t){}}s&&a._abort(new Error("JSONP script loaded abnormally (onreadystatechange)"))}},void 0===s.async&&t.document.attachEvent)if(i.isOpera())(o=this.script2=t.document.createElement("script")).text="try{var a = document.getElementById('"+s.id+"'); if(a)a.onerror();}catch(x){};",s.async=o.async=!1;else{try{s.htmlFor=s.id,s.event="onclick"}catch(l){}s.async=!0}void 0!==s.async&&(s.async=!0);var c=t.document.getElementsByTagName("head")[0];c.insertBefore(s,c.firstChild),o&&c.insertBefore(o,c.firstChild)},module.exports=c;
        },{"../../utils/iframe":"lHOv","../../utils/random":"kvjH","../../utils/browser":"+JeF","../../utils/url":"prkv","inherits":"oxw+","events":"6GPx"}],"76uW":[function(require,module,exports) {
            var global = arguments[3];
            var e,n,t=arguments[3],r=require("../../utils/random"),a=require("../../utils/url"),o=function(){};function d(e){o("createIframe",e);try{return t.document.createElement('<iframe name="'+e+'">')}catch(r){var n=t.document.createElement("iframe");return n.name=e,n}}function c(){o("createForm"),(e=t.document.createElement("form")).style.display="none",e.style.position="absolute",e.method="POST",e.enctype="application/x-www-form-urlencoded",e.acceptCharset="UTF-8",(n=t.document.createElement("textarea")).name="d",e.appendChild(n),t.document.body.appendChild(e)}module.exports=function(t,u,i){o(t,u),e||c();var l="a"+r.string(8);e.target=l,e.action=a.addQuery(a.addPath(t,"/jsonp_send"),"i="+l);var m=d(l);m.id=l,m.style.display="none",e.appendChild(m);try{n.value=u}catch(p){}e.submit();var s=function(e){o("completed",l,e),m.onerror&&(m.onreadystatechange=m.onerror=m.onload=null,setTimeout(function(){o("cleaning up",l),m.parentNode.removeChild(m),m=null},500),n.value="",i(e))};return m.onerror=function(){o("onerror",l),s()},m.onload=function(){o("onload",l),s()},m.onreadystatechange=function(e){o("onreadystatechange",l,m.readyState,e),"complete"===m.readyState&&s()},function(){o("aborted",l),s(new Error("Aborted"))}};
        },{"../../utils/random":"kvjH","../../utils/url":"prkv"}],"hI9h":[function(require,module,exports) {
            var global = arguments[3];
            var e=arguments[3],r=require("inherits"),n=require("./lib/sender-receiver"),i=require("./receiver/jsonp"),o=require("./sender/jsonp");function s(e){if(!s.enabled())throw new Error("Transport created when disabled");n.call(this,e,"/jsonp",o,i)}r(s,n),s.enabled=function(){return!!e.document},s.transportName="jsonp-polling",s.roundTrips=1,s.needBody=!0,module.exports=s;
        },{"inherits":"oxw+","./lib/sender-receiver":"sju2","./receiver/jsonp":"nruP","./sender/jsonp":"76uW"}],"jVqY":[function(require,module,exports) {
            "use strict";module.exports=[require("./transport/websocket"),require("./transport/xhr-streaming"),require("./transport/xdr-streaming"),require("./transport/eventsource"),require("./transport/lib/iframe-wrap")(require("./transport/eventsource")),require("./transport/htmlfile"),require("./transport/lib/iframe-wrap")(require("./transport/htmlfile")),require("./transport/xhr-polling"),require("./transport/xdr-polling"),require("./transport/lib/iframe-wrap")(require("./transport/xhr-polling")),require("./transport/jsonp-polling")];
        },{"./transport/websocket":"c80l","./transport/xhr-streaming":"a/LL","./transport/xdr-streaming":"UfBN","./transport/eventsource":"DuLI","./transport/lib/iframe-wrap":"XHhf","./transport/htmlfile":"+TEV","./transport/xhr-polling":"G9AK","./transport/xdr-polling":"GwrO","./transport/jsonp-polling":"hI9h"}],"+ldi":[function(require,module,exports) {
            "use strict";var t,n=Array.prototype,e=Object.prototype,r=Function.prototype,i=String.prototype,o=n.slice,l=e.toString,c=function(t){return"[object Function]"===e.toString.call(t)},a=function(t){return"[object Array]"===l.call(t)},u=function(t){return"[object String]"===l.call(t)},s=Object.defineProperty&&function(){try{return Object.defineProperty({},"x",{}),!0}catch(t){return!1}}();t=s?function(t,n,e,r){!r&&n in t||Object.defineProperty(t,n,{configurable:!0,enumerable:!1,writable:!0,value:e})}:function(t,n,e,r){!r&&n in t||(t[n]=e)};var p=function(n,r,i){for(var o in r)e.hasOwnProperty.call(r,o)&&t(n,o,r[o],i)},h=function(t){if(null==t)throw new TypeError("can't convert "+t+" to object");return Object(t)};function f(t){var n=+t;return n!=n?n=0:0!==n&&n!==1/0&&n!==-1/0&&(n=(n>0||-1)*Math.floor(Math.abs(n))),n}function g(t){return t>>>0}function y(){}p(r,{bind:function(t){var n=this;if(!c(n))throw new TypeError("Function.prototype.bind called on incompatible "+n);for(var e=o.call(arguments,1),r=Math.max(0,n.length-e.length),i=[],l=0;l<r;l++)i.push("$"+l);var a=Function("binder","return function ("+i.join(",")+"){ return binder.apply(this, arguments); }")(function(){if(this instanceof a){var r=n.apply(this,e.concat(o.call(arguments)));return Object(r)===r?r:this}return n.apply(t,e.concat(o.call(arguments)))});return n.prototype&&(y.prototype=n.prototype,a.prototype=new y,y.prototype=null),a}}),p(Array,{isArray:a});var b=Object("a"),v="a"!==b[0]||!(0 in b),d=function(t){var n=!0,e=!0;return t&&(t.call("foo",function(t,e,r){"object"!=typeof r&&(n=!1)}),t.call([1],function(){e="string"==typeof this},"x")),!!t&&n&&e};p(n,{forEach:function(t){var n=h(this),e=v&&u(this)?this.split(""):n,r=arguments[1],i=-1,o=e.length>>>0;if(!c(t))throw new TypeError;for(;++i<o;)i in e&&t.call(r,e[i],i,n)}},!d(n.forEach));var x=Array.prototype.indexOf&&-1!==[0,1].indexOf(1,2);p(n,{indexOf:function(t){var n=v&&u(this)?this.split(""):h(this),e=n.length>>>0;if(!e)return-1;var r=0;for(arguments.length>1&&(r=f(arguments[1])),r=r>=0?r:Math.max(0,e+r);r<e;r++)if(r in n&&n[r]===t)return r;return-1}},x);var j=i.split;2!=="ab".split(/(?:ab)*/).length||4!==".".split(/(.?)(.?)/).length||"t"==="tesst".split(/(s)*/)[1]||4!=="test".split(/(?:)/,-1).length||"".split(/.?/).length||".".split(/()()/).length>1?function(){var t=void 0===/()??/.exec("")[1];i.split=function(e,r){var i=this;if(void 0===e&&0===r)return[];if("[object RegExp]"!==l.call(e))return j.call(this,e,r);var o,c,a,u,s=[],p=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.extended?"x":"")+(e.sticky?"y":""),h=0;for(e=new RegExp(e.source,p+"g"),i+="",t||(o=new RegExp("^"+e.source+"$(?!\\s)",p)),r=void 0===r?-1>>>0:g(r);(c=e.exec(i))&&!((a=c.index+c[0].length)>h&&(s.push(i.slice(h,c.index)),!t&&c.length>1&&c[0].replace(o,function(){for(var t=1;t<arguments.length-2;t++)void 0===arguments[t]&&(c[t]=void 0)}),c.length>1&&c.index<i.length&&n.push.apply(s,c.slice(1)),u=c[0].length,h=a,s.length>=r));)e.lastIndex===c.index&&e.lastIndex++;return h===i.length?!u&&e.test("")||s.push(""):s.push(i.slice(h)),s.length>r?s.slice(0,r):s}}():"0".split(void 0,0).length&&(i.split=function(t,n){return void 0===t&&0===n?[]:j.call(this,t,n)});var w=i.substr,O="".substr&&"b"!=="0b".substr(-1);p(i,{substr:function(t,n){return w.call(this,t<0&&(t=this.length+t)<0?0:t,n)}},O);
        },{}],"80l2":[function(require,module,exports) {
            "use strict";var u,f=require("json3"),a=/[\x00-\x1f\ud800-\udfff\ufffe\uffff\u0300-\u0333\u033d-\u0346\u034a-\u034c\u0350-\u0352\u0357-\u0358\u035c-\u0362\u0374\u037e\u0387\u0591-\u05af\u05c4\u0610-\u0617\u0653-\u0654\u0657-\u065b\u065d-\u065e\u06df-\u06e2\u06eb-\u06ec\u0730\u0732-\u0733\u0735-\u0736\u073a\u073d\u073f-\u0741\u0743\u0745\u0747\u07eb-\u07f1\u0951\u0958-\u095f\u09dc-\u09dd\u09df\u0a33\u0a36\u0a59-\u0a5b\u0a5e\u0b5c-\u0b5d\u0e38-\u0e39\u0f43\u0f4d\u0f52\u0f57\u0f5c\u0f69\u0f72-\u0f76\u0f78\u0f80-\u0f83\u0f93\u0f9d\u0fa2\u0fa7\u0fac\u0fb9\u1939-\u193a\u1a17\u1b6b\u1cda-\u1cdb\u1dc0-\u1dcf\u1dfc\u1dfe\u1f71\u1f73\u1f75\u1f77\u1f79\u1f7b\u1f7d\u1fbb\u1fbe\u1fc9\u1fcb\u1fd3\u1fdb\u1fe3\u1feb\u1fee-\u1fef\u1ff9\u1ffb\u1ffd\u2000-\u2001\u20d0-\u20d1\u20d4-\u20d7\u20e7-\u20e9\u2126\u212a-\u212b\u2329-\u232a\u2adc\u302b-\u302c\uaab2-\uaab3\uf900-\ufa0d\ufa10\ufa12\ufa15-\ufa1e\ufa20\ufa22\ufa25-\ufa26\ufa2a-\ufa2d\ufa30-\ufa6d\ufa70-\ufad9\ufb1d\ufb1f\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufb4e\ufff0-\uffff]/g,e=function(u){var f,a={},e=[];for(f=0;f<65536;f++)e.push(String.fromCharCode(f));return u.lastIndex=0,e.join("").replace(u,function(u){return a[u]="\\u"+("0000"+u.charCodeAt(0).toString(16)).slice(-4),""}),u.lastIndex=0,a};module.exports={quote:function(d){var b=f.stringify(d);return a.lastIndex=0,a.test(b)?(u||(u=e(a)),b.replace(a,function(f){return u[f]})):b}};
        },{"json3":"r5wZ"}],"3t+s":[function(require,module,exports) {
            "use strict";var e=function(){};module.exports=function(t){return{filterToEnabled:function(a,r){var n={main:[],facade:[]};return a?"string"==typeof a&&(a=[a]):a=[],t.forEach(function(t){t&&("websocket"!==t.transportName||!1!==r.websocket?a.length&&-1===a.indexOf(t.transportName)?e("not in whitelist",t.transportName):t.enabled(r)?(e("enabled",t.transportName),n.main.push(t),t.facadeTransport&&n.facade.push(t.facadeTransport)):e("disabled",t.transportName):e("disabled from server","websocket"))}),n}}};
        },{}],"YVir":[function(require,module,exports) {
            var global = arguments[3];
            var o=arguments[3],n={};["log","debug","warn"].forEach(function(c){var l;try{l=o.console&&o.console[c]&&o.console[c].apply}catch(e){}n[c]=l?function(){return o.console[c].apply(o.console,arguments)}:"log"===c?function(){}:n.log}),module.exports=n;
        },{}],"Vudx":[function(require,module,exports) {
            "use strict";function t(t){this.type=t}t.prototype.initEvent=function(t,e,i){return this.type=t,this.bubbles=e,this.cancelable=i,this.timeStamp=+new Date,this},t.prototype.stopPropagation=function(){},t.prototype.preventDefault=function(){},t.CAPTURING_PHASE=1,t.AT_TARGET=2,t.BUBBLING_PHASE=3,module.exports=t;
        },{}],"sN6f":[function(require,module,exports) {
            var global = arguments[3];
            var o=arguments[3];module.exports=o.location||{origin:"http://localhost:80",protocol:"http:",host:"localhost",port:80,href:"http://localhost/",hash:""};
        },{}],"Ry1i":[function(require,module,exports) {
            "use strict";var e=require("inherits"),i=require("./event");function t(){i.call(this),this.initEvent("close",!1,!1),this.wasClean=!1,this.code=0,this.reason=""}e(t,i),module.exports=t;
        },{"inherits":"oxw+","./event":"Vudx"}],"/fK0":[function(require,module,exports) {
            "use strict";var e=require("inherits"),t=require("./event");function i(e){t.call(this),this.initEvent("message",!1,!1),this.data=e}e(i,t),module.exports=i;
        },{"inherits":"oxw+","./event":"Vudx"}],"950Q":[function(require,module,exports) {
            "use strict";var t=require("events").EventEmitter,e=require("inherits");function i(){var e=this;t.call(this),this.to=setTimeout(function(){e.emit("finish",200,"{}")},i.timeout)}e(i,t),i.prototype.close=function(){clearTimeout(this.to)},i.timeout=2e3,module.exports=i;
        },{"events":"6GPx","inherits":"oxw+"}],"2IH9":[function(require,module,exports) {
            "use strict";var e=require("events").EventEmitter,t=require("inherits"),i=require("json3"),s=require("./utils/object"),r=function(){};function n(t,n){e.call(this);var o=this,c=+new Date;this.xo=new n("GET",t),this.xo.once("finish",function(e,t){var n,u;if(200===e){if(u=+new Date-c,t)try{n=i.parse(t)}catch(h){r("bad json",t)}s.isObject(n)||(n={})}o.emit("finish",n,u),o.removeAllListeners()})}t(n,e),n.prototype.close=function(){this.removeAllListeners(),this.xo.close()},module.exports=n;
        },{"events":"6GPx","inherits":"oxw+","json3":"r5wZ","./utils/object":"ykCA"}],"bZ+U":[function(require,module,exports) {
            "use strict";var e=require("inherits"),i=require("events").EventEmitter,r=require("json3"),t=require("./transport/sender/xhr-local"),s=require("./info-ajax");function n(e){var n=this;i.call(this),this.ir=new s(e,t),this.ir.once("finish",function(e,i){n.ir=null,n.emit("message",r.stringify([e,i]))})}e(n,i),n.transportName="iframe-info-receiver",n.prototype.close=function(){this.ir&&(this.ir.close(),this.ir=null),this.removeAllListeners()},module.exports=n;
        },{"inherits":"oxw+","events":"6GPx","json3":"r5wZ","./transport/sender/xhr-local":"9mX/","./info-ajax":"2IH9"}],"/v8/":[function(require,module,exports) {
            var global = arguments[3];
            var e=arguments[3],i=require("events").EventEmitter,r=require("inherits"),t=require("json3"),n=require("./utils/event"),o=require("./transport/iframe"),s=require("./info-iframe-receiver"),a=function(){};function c(r,c){var u=this;i.call(this);var f=function(){var e=u.ifr=new o(s.transportName,c,r);e.once("message",function(e){if(e){var i;try{i=t.parse(e)}catch(o){return a("bad json",e),u.emit("finish"),void u.close()}var r=i[0],n=i[1];u.emit("finish",r,n)}u.close()}),e.once("close",function(){u.emit("finish"),u.close()})};e.document.body?f():n.attachEvent("load",f)}r(c,i),c.enabled=function(){return o.enabled()},c.prototype.close=function(){this.ifr&&this.ifr.close(),this.removeAllListeners(),this.ifr=null},module.exports=c;
        },{"events":"6GPx","inherits":"oxw+","json3":"r5wZ","./utils/event":"q8Q2","./transport/iframe":"B5iP","./info-iframe-receiver":"bZ+U"}],"cXIc":[function(require,module,exports) {
            "use strict";var e=require("events").EventEmitter,t=require("inherits"),i=require("./utils/url"),r=require("./transport/sender/xdr"),n=require("./transport/sender/xhr-cors"),o=require("./transport/sender/xhr-local"),s=require("./transport/sender/xhr-fake"),u=require("./info-iframe"),a=require("./info-ajax"),c=function(){};function h(t,i){c(t);var r=this;e.call(this),setTimeout(function(){r.doXhr(t,i)},0)}t(h,e),h._getReceiver=function(e,t,i){return i.sameOrigin?new a(t,o):n.enabled?new a(t,n):r.enabled&&i.sameScheme?new a(t,r):u.enabled()?new u(e,t):new a(t,s)},h.prototype.doXhr=function(e,t){var r=this,n=i.addPath(e,"/info");c("doXhr",n),this.xo=h._getReceiver(e,n,t),this.timeoutRef=setTimeout(function(){c("timeout"),r._cleanup(!1),r.emit("finish")},h.timeout),this.xo.once("finish",function(e,t){c("finish",e,t),r._cleanup(!0),r.emit("finish",e,t)})},h.prototype._cleanup=function(e){c("_cleanup"),clearTimeout(this.timeoutRef),this.timeoutRef=null,!e&&this.xo&&this.xo.close(),this.xo=null},h.prototype.close=function(){c("close"),this.removeAllListeners(),this._cleanup(!1)},h.timeout=8e3,module.exports=h;
        },{"events":"6GPx","inherits":"oxw+","./utils/url":"prkv","./transport/sender/xdr":"VmyL","./transport/sender/xhr-cors":"TBnt","./transport/sender/xhr-local":"9mX/","./transport/sender/xhr-fake":"950Q","./info-iframe":"/v8/","./info-ajax":"2IH9"}],"kS45":[function(require,module,exports) {
            "use strict";var t=require("json3"),s=require("./utils/iframe");function o(t){this._transport=t,t.on("message",this._transportMessage.bind(this)),t.on("close",this._transportClose.bind(this))}o.prototype._transportClose=function(o,e){s.postMessage("c",t.stringify([o,e]))},o.prototype._transportMessage=function(t){s.postMessage("t",t)},o.prototype._send=function(t){this._transport.send(t)},o.prototype._close=function(){this._transport.close(),this._transport.removeAllListeners()},module.exports=o;
        },{"json3":"r5wZ","./utils/iframe":"lHOv"}],"v+99":[function(require,module,exports) {
            "use strict";var r=require("./utils/url"),e=require("./utils/event"),a=require("json3"),i=require("./facade"),t=require("./info-iframe-receiver"),n=require("./utils/iframe"),o=require("./location"),s=function(){};module.exports=function(c,f){var u,d={};f.forEach(function(r){r.facadeTransport&&(d[r.facadeTransport.transportName]=r.facadeTransport)}),d[t.transportName]=t,c.bootstrap_iframe=function(){var t;n.currentWindowId=o.hash.slice(1);e.attachEvent("message",function(e){if(e.source===parent&&(void 0===u&&(u=e.origin),e.origin===u)){var f;try{f=a.parse(e.data)}catch(w){return void s("bad json",e.data)}if(f.windowId===n.currentWindowId)switch(f.type){case"s":var h;try{h=a.parse(f.data)}catch(w){s("bad json",f.data);break}var l=h[0],m=h[1],p=h[2],v=h[3];if(s(l,m,p,v),l!==c.version)throw new Error('Incompatible SockJS! Main site uses: "'+l+'", the iframe: "'+c.version+'".');if(!r.isOriginEqual(p,o.href)||!r.isOriginEqual(v,o.href))throw new Error("Can't connect to different domain from within an iframe. ("+o.href+", "+p+", "+v+")");t=new i(new d[m](p,v));break;case"m":t._send(f.data);break;case"c":t&&t._close(),t=null}}}),n.postMessage("s")}};
        },{"./utils/url":"prkv","./utils/event":"q8Q2","json3":"r5wZ","./facade":"kS45","./info-iframe-receiver":"bZ+U","./utils/iframe":"lHOv","./location":"sN6f"}],"FIM5":[function(require,module,exports) {
            var global = arguments[3];
            var t=arguments[3];require("./shims");var r,e=require("url-parse"),s=require("inherits"),i=require("json3"),o=require("./utils/random"),n=require("./utils/escape"),a=require("./utils/url"),h=require("./utils/event"),l=require("./utils/transport"),p=require("./utils/object"),c=require("./utils/browser"),u=require("./utils/log"),d=require("./event/event"),_=require("./event/eventtarget"),f=require("./location"),m=require("./event/close"),y=require("./event/trans-message"),v=require("./info-receiver"),S=function(){};function w(t,r,s){if(!(this instanceof w))return new w(t,r,s);if(arguments.length<1)throw new TypeError("Failed to construct 'SockJS: 1 argument required, but only 0 present");_.call(this),this.readyState=w.CONNECTING,this.extensions="",this.protocol="",(s=s||{}).protocols_whitelist&&u.warn("'protocols_whitelist' is DEPRECATED. Use 'transports' instead."),this._transportsWhitelist=s.transports,this._transportOptions=s.transportOptions||{};var i=s.sessionId||8;if("function"==typeof i)this._generateSessionId=i;else{if("number"!=typeof i)throw new TypeError("If sessionId is used in the options, it needs to be a number or a function.");this._generateSessionId=function(){return o.string(i)}}this._server=s.server||o.numberString(1e3);var n=new e(t);if(!n.host||!n.protocol)throw new SyntaxError("The URL '"+t+"' is invalid");if(n.hash)throw new SyntaxError("The URL must not contain a fragment");if("http:"!==n.protocol&&"https:"!==n.protocol)throw new SyntaxError("The URL's scheme must be either 'http:' or 'https:'. '"+n.protocol+"' is not allowed.");var h="https:"===n.protocol;if("https:"===f.protocol&&!h)throw new Error("SecurityError: An insecure SockJS connection may not be initiated from a page loaded over HTTPS");r?Array.isArray(r)||(r=[r]):r=[];var l=r.sort();l.forEach(function(t,r){if(!t)throw new SyntaxError("The protocols entry '"+t+"' is invalid.");if(r<l.length-1&&t===l[r+1])throw new SyntaxError("The protocols entry '"+t+"' is duplicated.")});var p=a.getOrigin(f.href);this._origin=p?p.toLowerCase():null,n.set("pathname",n.pathname.replace(/\/+$/,"")),this.url=n.href,S("using url",this.url),this._urlInfo={nullOrigin:!c.hasDomain(),sameOrigin:a.isOriginEqual(this.url,f.href),sameScheme:a.isSchemeEqual(this.url,f.href)},this._ir=new v(this.url,this._urlInfo),this._ir.once("finish",this._receiveInfo.bind(this))}function E(t){return 1e3===t||t>=3e3&&t<=4999}s(w,_),w.prototype.close=function(t,r){if(t&&!E(t))throw new Error("InvalidAccessError: Invalid code");if(r&&r.length>123)throw new SyntaxError("reason argument has an invalid length");if(this.readyState!==w.CLOSING&&this.readyState!==w.CLOSED){this._close(t||1e3,r||"Normal closure",!0)}},w.prototype.send=function(t){if("string"!=typeof t&&(t=""+t),this.readyState===w.CONNECTING)throw new Error("InvalidStateError: The connection has not been established yet");this.readyState===w.OPEN&&this._transport.send(n.quote(t))},w.version=require("./version"),w.CONNECTING=0,w.OPEN=1,w.CLOSING=2,w.CLOSED=3,w.prototype._receiveInfo=function(t,e){if(S("_receiveInfo",e),this._ir=null,t){this._rto=this.countRTO(e),this._transUrl=t.base_url?t.base_url:this.url,t=p.extend(t,this._urlInfo),S("info",t);var s=r.filterToEnabled(this._transportsWhitelist,t);this._transports=s.main,S(this._transports.length+" enabled transports"),this._connect()}else this._close(1002,"Cannot connect to server")},w.prototype._connect=function(){for(var r=this._transports.shift();r;r=this._transports.shift()){if(S("attempt",r.transportName),r.needBody&&(!t.document.body||void 0!==t.document.readyState&&"complete"!==t.document.readyState&&"interactive"!==t.document.readyState))return S("waiting for body"),this._transports.unshift(r),void h.attachEvent("load",this._connect.bind(this));var e=this._rto*r.roundTrips||5e3;this._transportTimeoutId=setTimeout(this._transportTimeout.bind(this),e),S("using timeout",e);var s=a.addPath(this._transUrl,"/"+this._server+"/"+this._generateSessionId()),i=this._transportOptions[r.transportName];S("transport url",s);var o=new r(s,this._transUrl,i);return o.on("message",this._transportMessage.bind(this)),o.once("close",this._transportClose.bind(this)),o.transportName=r.transportName,void(this._transport=o)}this._close(2e3,"All transports failed",!1)},w.prototype._transportTimeout=function(){S("_transportTimeout"),this.readyState===w.CONNECTING&&(this._transport&&this._transport.close(),this._transportClose(2007,"Transport timed out"))},w.prototype._transportMessage=function(t){S("_transportMessage",t);var r,e=this,s=t.slice(0,1),o=t.slice(1);switch(s){case"o":return void this._open();case"h":return this.dispatchEvent(new d("heartbeat")),void S("heartbeat",this.transport)}if(o)try{r=i.parse(o)}catch(n){S("bad json",o)}if(void 0!==r)switch(s){case"a":Array.isArray(r)&&r.forEach(function(t){S("message",e.transport,t),e.dispatchEvent(new y(t))});break;case"m":S("message",this.transport,r),this.dispatchEvent(new y(r));break;case"c":Array.isArray(r)&&2===r.length&&this._close(r[0],r[1],!0)}else S("empty payload",o)},w.prototype._transportClose=function(t,r){S("_transportClose",this.transport,t,r),this._transport&&(this._transport.removeAllListeners(),this._transport=null,this.transport=null),E(t)||2e3===t||this.readyState!==w.CONNECTING?this._close(t,r):this._connect()},w.prototype._open=function(){S("_open",this._transport.transportName,this.readyState),this.readyState===w.CONNECTING?(this._transportTimeoutId&&(clearTimeout(this._transportTimeoutId),this._transportTimeoutId=null),this.readyState=w.OPEN,this.transport=this._transport.transportName,this.dispatchEvent(new d("open")),S("connected",this.transport)):this._close(1006,"Server lost session")},w.prototype._close=function(t,r,e){S("_close",this.transport,t,r,e,this.readyState);var s=!1;if(this._ir&&(s=!0,this._ir.close(),this._ir=null),this._transport&&(this._transport.close(),this._transport=null,this.transport=null),this.readyState===w.CLOSED)throw new Error("InvalidStateError: SockJS has already been closed");this.readyState=w.CLOSING,setTimeout(function(){this.readyState=w.CLOSED,s&&this.dispatchEvent(new d("error"));var i=new m("close");i.wasClean=e||!1,i.code=t||1e3,i.reason=r,this.dispatchEvent(i),this.onmessage=this.onclose=this.onerror=null,S("disconnected")}.bind(this),0)},w.prototype.countRTO=function(t){return t>100?4*t:300+t},module.exports=function(t){return r=l(t),require("./iframe-bootstrap")(w,t),w};
        },{"./shims":"+ldi","url-parse":"WxRL","inherits":"oxw+","json3":"r5wZ","./utils/random":"kvjH","./utils/escape":"80l2","./utils/url":"prkv","./utils/event":"q8Q2","./utils/transport":"3t+s","./utils/object":"ykCA","./utils/browser":"+JeF","./utils/log":"YVir","./event/event":"Vudx","./event/eventtarget":"PUqX","./location":"sN6f","./event/close":"Ry1i","./event/trans-message":"/fK0","./info-receiver":"cXIc","./version":"A8Oj","./iframe-bootstrap":"v+99"}],"EWtC":[function(require,module,exports) {
            var global = arguments[3];
            var o=arguments[3],e=require("./transport-list");module.exports=require("./main")(e),"_sockjs_onload"in o&&setTimeout(o._sockjs_onload,1);
        },{"./transport-list":"jVqY","./main":"FIM5"}],"wTgU":[function(require,module,exports) {
            !function(){var e="object"==typeof exports&&null!==exports&&"number"!=typeof exports.nodeType?exports:"undefined"!=typeof self?self:$.global,t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function r(e){this.message=e}r.prototype=new Error,r.prototype.name="InvalidCharacterError",e.btoa||(e.btoa=function(e){for(var o,n,a=String(e),i=0,c=t,f="";a.charAt(0|i)||(c="=",i%1);f+=c.charAt(63&o>>8-i%1*8)){if((n=a.charCodeAt(i+=.75))>255)throw new r("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");o=o<<8|n}return f}),e.atob||(e.atob=function(e){var o=String(e).replace(/[=]+$/,"");if(o.length%4==1)throw new r("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,a,i=0,c=0,f="";a=o.charAt(c++);~a&&(n=i%4?64*n+a:a,i++%4)?f+=String.fromCharCode(255&n>>(-2*i&6)):0)a=t.indexOf(a);return f})}();
        },{}],"KLYY":[function(require,module,exports) {
            "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var E=function(){return{WEBIM_CONNCTION_USER_NOT_ASSIGN_ERROR:0,WEBIM_CONNCTION_OPEN_ERROR:1,WEBIM_CONNCTION_AUTH_ERROR:2,WEBIM_CONNCTION_OPEN_USERGRID_ERROR:3,WEBIM_CONNCTION_ATTACH_ERROR:4,WEBIM_CONNCTION_ATTACH_USERGRID_ERROR:5,WEBIM_CONNCTION_REOPEN_ERROR:6,WEBIM_CONNCTION_SERVER_CLOSE_ERROR:7,WEBIM_CONNCTION_SERVER_ERROR:8,WEBIM_CONNCTION_IQ_ERROR:9,WEBIM_CONNCTION_USER_REMOVED:207,WEBIM_CONNCTION_USER_LOGIN_ANOTHER_DEVICE:206,WEBIM_CONNCTION_USER_KICKED_BY_CHANGE_PASSWORD:216,WEBIM_CONNCTION_USER_KICKED_BY_OTHER_DEVICE:217,WEBIM_CONNCTION_PING_ERROR:10,WEBIM_CONNCTION_NOTIFYVERSION_ERROR:11,WEBIM_CONNCTION_GETROSTER_ERROR:12,WEBIM_CONNCTION_CROSSDOMAIN_ERROR:13,WEBIM_CONNCTION_LISTENING_OUTOF_MAXRETRIES:14,WEBIM_CONNCTION_RECEIVEMSG_CONTENTERROR:15,WEBIM_CONNCTION_DISCONNECTED:16,WEBIM_CONNCTION_AJAX_ERROR:17,WEBIM_CONNCTION_JOINROOM_ERROR:18,WEBIM_CONNCTION_GETROOM_ERROR:19,WEBIM_CONNCTION_GETROOMINFO_ERROR:20,WEBIM_CONNCTION_GETROOMMEMBER_ERROR:21,WEBIM_CONNCTION_GETROOMOCCUPANTS_ERROR:22,WEBIM_CONNCTION_LOAD_CHATROOM_ERROR:23,WEBIM_CONNCTION_NOT_SUPPORT_CHATROOM_ERROR:24,WEBIM_CONNCTION_JOINCHATROOM_ERROR:25,WEBIM_CONNCTION_QUITCHATROOM_ERROR:26,WEBIM_CONNCTION_APPKEY_NOT_ASSIGN_ERROR:27,WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR:28,WEBIM_CONNCTION_SESSIONID_NOT_ASSIGN_ERROR:29,WEBIM_CONNCTION_RID_NOT_ASSIGN_ERROR:30,WEBIM_CONNCTION_CALLBACK_INNER_ERROR:31,WEBIM_CONNCTION_CLIENT_OFFLINE:32,WEBIM_CONNCTION_CLIENT_LOGOUT:33,WEBIM_CONNCTION_CLIENT_TOO_MUCH_ERROR:34,WEBIM_CONNECTION_ACCEPT_INVITATION_FROM_GROUP:35,WEBIM_CONNECTION_DECLINE_INVITATION_FROM_GROUP:36,WEBIM_CONNECTION_ACCEPT_JOIN_GROUP:37,WEBIM_CONNECTION_DECLINE_JOIN_GROUP:38,WEBIM_CONNECTION_CLOSED:39,WEBIM_UPLOADFILE_BROWSER_ERROR:100,WEBIM_UPLOADFILE_ERROR:101,WEBIM_UPLOADFILE_NO_LOGIN:102,WEBIM_UPLOADFILE_NO_FILE:103,WEBIM_DOWNLOADFILE_ERROR:200,WEBIM_DOWNLOADFILE_NO_LOGIN:201,WEBIM_DOWNLOADFILE_BROWSER_ERROR:202,WEBIM_MESSAGE_REC_TEXT:300,WEBIM_MESSAGE_REC_TEXT_ERROR:301,WEBIM_MESSAGE_REC_EMOTION:302,WEBIM_MESSAGE_REC_PHOTO:303,WEBIM_MESSAGE_REC_AUDIO:304,WEBIM_MESSAGE_REC_AUDIO_FILE:305,WEBIM_MESSAGE_REC_VEDIO:306,WEBIM_MESSAGE_REC_VEDIO_FILE:307,WEBIM_MESSAGE_REC_FILE:308,WEBIM_MESSAGE_SED_TEXT:309,WEBIM_MESSAGE_SED_EMOTION:310,WEBIM_MESSAGE_SED_PHOTO:311,WEBIM_MESSAGE_SED_AUDIO:312,WEBIM_MESSAGE_SED_AUDIO_FILE:313,WEBIM_MESSAGE_SED_VEDIO:314,WEBIM_MESSAGE_SED_VEDIO_FILE:315,WEBIM_MESSAGE_SED_FILE:316,WEBIM_MESSAGE_SED_ERROR:317,STATUS_INIT:400,STATUS_DOLOGIN_USERGRID:401,STATUS_DOLOGIN_IM:402,STATUS_OPENED:403,STATUS_CLOSING:404,STATUS_CLOSED:405,STATUS_ERROR:406}},_=E;exports.default=_;
        },{}],"K0yk":[function(require,module,exports) {
            "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=t(require("./status"));function t(e){return e&&e.__esModule?e:{default:e}}function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var n=function(){},o=(0,e.default)(),a=10485760,i=function(){try{return new window.XMLHttpRequest}catch(e){return!1}},s=function(){try{return new window.ActiveXObject("Microsoft.XMLHTTP")}catch(e){return!1}},l=function(e){e=e||!0;var t=i()||s();if("withCredentials"in t)return t;if(!e)return t;if(void 0===window.XDomainRequest)return t;var r=new XDomainRequest;return r.readyState=0,r.status=100,r.onreadystatechange=n,r.onload=function(){r.readyState=4,r.status=200;var e=new ActiveXObject("Microsoft.XMLDOM");e.async="false",e.loadXML(r.responseText),r.responseXML=e,r.response=r.responseText,r.onreadystatechange()},r.ontimeout=r.onerror=function(){r.readyState=4,r.status=500,r.onreadystatechange()},r},d=function(){if("ActiveXObject"in window)try{return new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(e){return 0}else if(navigator.plugins&&navigator.plugins.length>0)return navigator.plugins["Shockwave Flash"];return 0}(),p=l(),u="undefined"!=typeof FormData,c="undefined"!=typeof Blob,f=p.setRequestHeader||!1,y=p.overrideMimeType||!1,v=f&&u,h=v||d,O=f&&(c||y);Object.keys||(Object.keys=function(){var e=Object.prototype.hasOwnProperty,t=!{toString:null}.propertyIsEnumerable("toString"),n=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],o=n.length;return function(a){if("object"!==r(a)&&("function"!=typeof a||null===a))throw new TypeError("Object.keys called on non-object");var i,s,l=[];for(i in a)e.call(a,i)&&l.push(i);if(t)for(s=0;s<o;s++)e.call(a,n[s])&&l.push(n[s]);return l}}());var m={hasFormData:u,hasBlob:c,emptyfn:n,isCanSetRequestHeader:f,hasOverrideMimeType:y,isCanUploadFileAsync:v,isCanUploadFile:h,isCanDownLoadFile:O,isSupportWss:function(){var e=[/MQQBrowser[\/]5([.]\d+)?\sTBS/];if(!window.WebSocket)return!1;for(var t=window.navigator.userAgent,r=0,n=e.length;r<n;r++)if(e[r].test(t))return!1;return!0}(),getIEVersion:function(){var e,t=navigator.userAgent;return(e=t.match(/MSIE (\d+)/i))&&e[1]?+e[1]:(e=t.match(/Trident\/(\d+)/i))&&e[1]&&{4:8,5:9,6:10,7:11}[e[1]]||null}(),stringify:function(e){if("undefined"!=typeof JSON&&JSON.stringify)return JSON.stringify(e);var t="",n=[];return function e(o){var a=!1;for(var i in"[object Array]"===Object.prototype.toString.call(o)?(n.push("]","["),a=!0):"[object Object]"===Object.prototype.toString.call(o)&&n.push("}","{"),o)"[object Null]"===Object.prototype.toString.call(o[i])?o[i]="null":"[object Undefined]"===Object.prototype.toString.call(o[i])&&(o[i]="undefined"),o[i]&&"object"===r(o[i])?t+=","+(a?"":'"'+i+'":'+(a?'"':""))+e(o[i]):t+=',"'+(a?"":i+'":"')+o[i]+'"';return""!=t&&(t=t.slice(1)),n.pop()+t+n.pop()}(e)},login:function(e){var t=(e=e||{}).success||n,r=e.error||n,a=(e.appKey||"").split("#");if(2!==a.length)return r({type:o.WEBIM_CONNCTION_APPKEY_NOT_ASSIGN_ERROR}),!1;var i=a[0],s=a[1],l=l||e.https,d=e.user||"",p=e.pwd||"",u=e.apiUrl,c={grant_type:"password",username:d,password:p,timestamp:+new Date};e={url:u+"/"+i+"/"+s+"/token",dataType:"json",data:m.stringify(c),success:t,error:r};return m.ajax(e)},getFileUrl:function(e){var t={url:"",filename:"",filetype:"",data:""},r="string"==typeof e?document.getElementById(e):e;if(!m.isCanUploadFileAsync||!r)return t;try{if(window.URL.createObjectURL){var n=r.files;if(n.length>0){var o=n.item(0);t.data=o,t.url=window.URL.createObjectURL(o),t.filename=o.name||""}}else{o=document.getElementById(e).value;t.url=o;var a=o.lastIndexOf("/"),i=o.lastIndexOf("\\"),s=Math.max(a,i);t.filename=s<0?o:o.substring(s+1)}var l=t.filename.lastIndexOf(".");return-1!=l&&(t.filetype=t.filename.substring(l+1).toLowerCase()),t}catch(d){throw d}},getFileSize:function(e){var t=this.getFileLength(e);if(t>1e7)return!1;var r=Math.round(t/1e3);if(r<1e3)t=r+" KB";else if(r>=1e3){var n=r/1e3;if(n<1e3)t=n.toFixed(1)+" MB";else t=(n/1e3).toFixed(1)+" GB"}return t},getFileLength:function(e){var t=0;if(e)if(e.files)e.files.length>0&&(t=e.files[0].size);else if(e.select&&"ActiveXObject"in window){e.select(),t=(e=new ActiveXObject("Scripting.FileSystemObject").GetFile(e.value)).Size}return t},hasFlash:d,trim:function(e){return(e="string"==typeof e?e:"").trim?e.trim():e.replace(/^\s|\s$/g,"")},parseEmoji:function(e){if(void 0===WebIM.Emoji||void 0===WebIM.Emoji.map)return e;var t=WebIM.Emoji;for(var r in t.map)if(t.map.hasOwnProperty(r))for(;e.indexOf(r)>-1;)e=e.replace(r,'<img class="emoji" src="'+t.path+t.map[r]+'" />');return e},parseLink:function(e){return e=e.replace(/(https?\:\/\/|www\.)([a-zA-Z0-9-]+(\.[a-zA-Z0-9]+)+)(\:[0-9]{2,4})?\/?((\.[:_0-9a-zA-Z-]+)|[:_0-9a-zA-Z-]*\/?)*\??[:_#@*&%0-9a-zA-Z-\/=]*/gm,function(e){return"<a href='"+(/^https?/gm.test(e)?e:"//"+e)+"' target='_blank'>"+e+"</a>"})},parseJSON:function(e){if(window.JSON&&window.JSON.parse)return window.JSON.parse(e+"");var t,r=null,n=m.trim(e+"");return n&&!m.trim(n.replace(/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g,function(e,n,o,a){return t&&n&&(r=0),0===r?e:(t=o||n,r+=!a-!o,"")}))?Function("return "+n)():Function("Invalid JSON: "+e)()},parseUploadResponse:function(e){return e.indexOf("callback")>-1?e.slice(9,-1):e},parseDownloadResponse:function(e){return e&&e.type&&"application/json"===e.type||0>Object.prototype.toString.call(e).indexOf("Blob")?this.url+"?token=":window.URL.createObjectURL(e)},uploadFile:function(e){(e=e||{}).onFileUploadProgress=e.onFileUploadProgress||n,e.onFileUploadComplete=e.onFileUploadComplete||n,e.onFileUploadError=e.onFileUploadError||n,e.onFileUploadCanceled=e.onFileUploadCanceled||n;var t=e.accessToken||this.context.accessToken;if(t){var r,i,s,l=e.appKey||this.context.appKey||"";if(l&&(r=(s=l.split("#"))[0],i=s[1]),r||i){var d=e.apiUrl;"https:"!=location.protocol&&this.isHttpDNS&&(d=this.apiUrl);var p=d+"/"+r+"/"+i+"/chatfiles";if(m.isCanUploadFileAsync){var u=e.file.data?e.file.data.size:void 0;if(u>a)e.onFileUploadError({type:o.WEBIM_UPLOADFILE_ERROR,id:e.id});else if(u<=0)e.onFileUploadError({type:o.WEBIM_UPLOADFILE_ERROR,id:e.id});else{var c=m.xmlrequest();c.upload&&c.upload.addEventListener("progress",e.onFileUploadProgress,!1),c.addEventListener?(c.addEventListener("abort",e.onFileUploadCanceled,!1),c.addEventListener("load",function(t){try{var r=m.parseJSON(c.responseText);try{e.onFileUploadComplete(r)}catch(t){e.onFileUploadError({type:o.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,data:t})}}catch(t){e.onFileUploadError({type:o.WEBIM_UPLOADFILE_ERROR,data:c.responseText,id:e.id,xhr:c})}},!1),c.addEventListener("error",function(t){e.onFileUploadError({type:o.WEBIM_UPLOADFILE_ERROR,id:e.id,xhr:c})},!1)):c.onreadystatechange&&(c.onreadystatechange=function(){if(4===c.readyState)if(200===ajax.status)try{var t=m.parseJSON(c.responseText);e.onFileUploadComplete(t)}catch(r){e.onFileUploadError({type:o.WEBIM_UPLOADFILE_ERROR,data:c.responseText,id:e.id,xhr:c})}else e.onFileUploadError({type:o.WEBIM_UPLOADFILE_ERROR,data:c.responseText,id:e.id,xhr:c});else c.abort(),e.onFileUploadCanceled()}),c.open("POST",p),c.setRequestHeader("restrict-access","true"),c.setRequestHeader("Accept","*/*"),c.setRequestHeader("Authorization","Bearer "+t);var f=new FormData;f.append("file",e.file.data),window.XDomainRequest&&(c.readyState=2),c.send(f)}}else m.hasFlash&&"function"==typeof e.flashUpload?e.flashUpload&&e.flashUpload(p,e):e.onFileUploadError({type:o.WEBIM_UPLOADFILE_BROWSER_ERROR,id:e.id})}else e.onFileUploadError({type:o.WEBIM_UPLOADFILE_ERROR,id:e.id})}else e.onFileUploadError({type:o.WEBIM_UPLOADFILE_NO_LOGIN,id:e.id})},download:function(e){e.onFileDownloadComplete=e.onFileDownloadComplete||n,e.onFileDownloadError=e.onFileDownloadError||n;var t=e.accessToken||this.context.accessToken;if(t){if(m.isCanDownLoadFile){var r=m.xmlrequest();"addEventListener"in r?(r.addEventListener("load",function(t){e.onFileDownloadComplete(r.response,r)},!1),r.addEventListener("error",function(t){e.onFileDownloadError({type:o.WEBIM_DOWNLOADFILE_ERROR,id:e.id,xhr:r})},!1)):"onreadystatechange"in r&&(r.onreadystatechange=function(){4===r.readyState?200===ajax.status?e.onFileDownloadComplete(r.response,r):e.onFileDownloadError({type:o.WEBIM_DOWNLOADFILE_ERROR,id:e.id,xhr:r}):(r.abort(),e.onFileDownloadError({type:o.WEBIM_DOWNLOADFILE_ERROR,id:e.id,xhr:r}))});var a=e.method||"GET",i=e.responseType||"blob",s=e.mimeType||"text/plain; charset=x-user-defined";r.open(a,e.url),"undefined"!=typeof Blob?r.responseType=i:r.overrideMimeType(s);var l={"X-Requested-With":"XMLHttpRequest",Accept:"application/octet-stream","share-secret":e.secret,Authorization:"Bearer "+t},d=e.headers||{};for(var p in d)l[p]=d[p];for(var p in l)l[p]&&r.setRequestHeader(p,l[p]);window.XDomainRequest&&(r.readyState=2),r.send(null)}else e.onFileDownloadComplete()}else e.onFileDownloadError({type:o.WEBIM_DOWNLOADFILE_NO_LOGIN,id:e.id})},parseTextMessage:function(e,t){if("string"==typeof e){if("[object Object]"!==Object.prototype.toString.call(t))return{isemoji:!1,body:[{type:"txt",data:e}]};var r=e,n=[],o=r.match(/\[[^[\]]{2,3}\]/gm);if(!o||o.length<1)return{isemoji:!1,body:[{type:"txt",data:e}]};for(var a=!1,i=0;i<o.length;i++){var s=r.substring(0,r.indexOf(o[i])),l=WebIM.Emoji.map[o[i]];if(s&&n.push({type:"txt",data:s}),l){var d=WebIM.Emoji.map?WebIM.Emoji.path+l:null;d?(a=!0,n.push({type:"emoji",data:d})):n.push({type:"txt",data:o[i]});var p=r.indexOf(o[i])+o[i].length;r=r.substring(p)}else n.push({type:"txt",data:o[i]})}return r&&n.push({type:"txt",data:r}),a?{isemoji:a,body:n}:{isemoji:!1,body:[{type:"txt",data:e}]}}},parseUri:function(){var e={};if(window.location.search){var t=window.location.search.match(/([^\?|&])\w+=([^&]+)/g);for(var r in t){var n=t[r],o=n.indexOf("="),a=n.substr(0,o),i=n.substr(o+1);e[a]=i}}return e},parseHrefHash:function(){var e={};if(window.location.hash){var t=window.location.hash.match(/([^\#|&])\w+=([^&]+)/g);for(var r in t){var n=t[r],o=n.indexOf("="),a=n.substr(0,o),i=n.substr(o+1);e[a]=i}}return e},xmlrequest:l,getXmlFirstChild:function(e,t){var r=e.getElementsByTagName(t);return 0==r.length?null:r[0]},ajax:function(e){var t=e.dataType||"text",r=e.success||n,a=e.error||n,i=m.xmlrequest();i.onreadystatechange=function(){if(4!==i.readyState)0===i.readyState&&a({type:o.WEBIM_CONNCTION_AJAX_ERROR,data:i.responseText});else{if(200===(i.status||0)){try{switch(t){case"text":return void r(i.responseText);case"json":var e=m.parseJSON(i.responseText);return void r(e,i);case"xml":return void(i.responseXML&&i.responseXML.documentElement?r(i.responseXML.documentElement,i):a({type:o.WEBIM_CONNCTION_AJAX_ERROR,data:i.responseText}))}r(i.response||i.responseText,i)}catch(n){a({type:o.WEBIM_CONNCTION_AJAX_ERROR,data:n})}return}a({type:o.WEBIM_CONNCTION_AJAX_ERROR,data:i.responseText})}},e.responseType&&i.responseType&&(i.responseType=e.responseType),e.mimeType&&m.hasOverrideMimeType&&i.overrideMimeType(e.mimeType);var s=e.type||"POST",l=e.data||null,d="";if("get"===s.toLowerCase()&&l){for(var p in l)l.hasOwnProperty(p)&&(d+=p+"="+l[p]+"&");d=d?d.slice(0,-1):d,e.url+=(e.url.indexOf("?")>0?"&":"?")+(d?d+"&":d)+"_v="+(new Date).getTime(),l=null,d=null}if(i.open(s,e.url,m.isCanSetRequestHeader),m.isCanSetRequestHeader){var u=e.headers||{};for(var c in u)u.hasOwnProperty(c)&&i.setRequestHeader(c,u[c])}return window.XDomainRequest&&(i.readyState=2),i.send(l),i},ts:function(){var e=new Date,t=e.getHours(),r=e.getMinutes(),n=e.getSeconds();return(t<10?"0"+t:t)+":"+(r<10?"0"+r:r)+":"+(n<10?"0"+n:n)+":"+e.getMilliseconds()+" "},getObjectKey:function(e,t){for(var r in e)if(e[r]==t)return r;return""},sprintf:function(){var e,t,r=arguments,n=r[0]||"";for(e=1,t=r.length;e<t;e++)n=n.replace(/%s/,r[e]);return n},setCookie:function(e,t,r){var n=e+"="+encodeURIComponent(t);"number"==typeof r&&(n+="; max-age: "+60*r*60*24),document.cookie=n},getCookie:function(){var e={},t=document.cookie;if(""===t)return e;for(var r=t.split("; "),n=0;n<r.length;n++){var o=r[n],a=o.indexOf("="),i=o.substring(0,a),s=o.substring(a+1);s=decodeURIComponent(s),e[i]=s}return e},reverse:function(e){var t=[];if(Array.prototype.reverse)t=e.reverse();else for(var r=0;r<e.length;r++)t.unshift(e[r]);return t}},E=m;exports.default=E;
        },{"./status":"KLYY"}],"eUTO":[function(require,module,exports) {
            var define;
            var t;!function(n,i){"object"==typeof exports?module.exports=exports=i():"function"==typeof t&&t.amd?t([],i):n.CryptoJS=i()}(this,function(){var t=t||function(t,n){var i=Object.create||function(){function t(){}return function(n){var i;return t.prototype=n,i=new t,t.prototype=null,i}}(),r={},e=r.lib={},o=e.Base={extend:function(t){var n=i(this);return t&&n.mixIn(t),n.hasOwnProperty("init")&&this.init!==n.init||(n.init=function(){n.$super.init.apply(this,arguments)}),n.init.prototype=n,n.$super=this,n},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var n in t)t.hasOwnProperty(n)&&(this[n]=t[n]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}},s=e.WordArray=o.extend({init:function(t,n){t=this.words=t||[],this.sigBytes=null!=n?n:4*t.length},toString:function(t){return(t||c).stringify(this)},concat:function(t){var n=this.words,i=t.words,r=this.sigBytes,e=t.sigBytes;if(this.clamp(),r%4)for(var o=0;o<e;o++){var s=i[o>>>2]>>>24-o%4*8&255;n[r+o>>>2]|=s<<24-(r+o)%4*8}else for(o=0;o<e;o+=4)n[r+o>>>2]=i[o>>>2];return this.sigBytes+=e,this},clamp:function(){var n=this.words,i=this.sigBytes;n[i>>>2]&=4294967295<<32-i%4*8,n.length=t.ceil(i/4)},clone:function(){var t=o.clone.call(this);return t.words=this.words.slice(0),t},random:function(n){for(var i,r=[],e=function(n){n=n;var i=987654321,r=4294967295;return function(){var e=((i=36969*(65535&i)+(i>>16)&r)<<16)+(n=18e3*(65535&n)+(n>>16)&r)&r;return e/=4294967296,(e+=.5)*(t.random()>.5?1:-1)}},o=0;o<n;o+=4){var a=e(4294967296*(i||t.random()));i=987654071*a(),r.push(4294967296*a()|0)}return new s.init(r,n)}}),a=r.enc={},c=a.Hex={stringify:function(t){for(var n=t.words,i=t.sigBytes,r=[],e=0;e<i;e++){var o=n[e>>>2]>>>24-e%4*8&255;r.push((o>>>4).toString(16)),r.push((15&o).toString(16))}return r.join("")},parse:function(t){for(var n=t.length,i=[],r=0;r<n;r+=2)i[r>>>3]|=parseInt(t.substr(r,2),16)<<24-r%8*4;return new s.init(i,n/2)}},u=a.Latin1={stringify:function(t){for(var n=t.words,i=t.sigBytes,r=[],e=0;e<i;e++){var o=n[e>>>2]>>>24-e%4*8&255;r.push(String.fromCharCode(o))}return r.join("")},parse:function(t){for(var n=t.length,i=[],r=0;r<n;r++)i[r>>>2]|=(255&t.charCodeAt(r))<<24-r%4*8;return new s.init(i,n)}},f=a.Utf8={stringify:function(t){try{return decodeURIComponent(escape(u.stringify(t)))}catch(n){throw new Error("Malformed UTF-8 data")}},parse:function(t){return u.parse(unescape(encodeURIComponent(t)))}},h=e.BufferedBlockAlgorithm=o.extend({reset:function(){this._data=new s.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=f.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(n){var i=this._data,r=i.words,e=i.sigBytes,o=this.blockSize,a=e/(4*o),c=(a=n?t.ceil(a):t.max((0|a)-this._minBufferSize,0))*o,u=t.min(4*c,e);if(c){for(var f=0;f<c;f+=o)this._doProcessBlock(r,f);var h=r.splice(0,c);i.sigBytes-=u}return new s.init(h,u)},clone:function(){var t=o.clone.call(this);return t._data=this._data.clone(),t},_minBufferSize:0}),p=(e.Hasher=h.extend({cfg:o.extend(),init:function(t){this.cfg=this.cfg.extend(t),this.reset()},reset:function(){h.reset.call(this),this._doReset()},update:function(t){return this._append(t),this._process(),this},finalize:function(t){return t&&this._append(t),this._doFinalize()},blockSize:16,_createHelper:function(t){return function(n,i){return new t.init(i).finalize(n)}},_createHmacHelper:function(t){return function(n,i){return new p.HMAC.init(t,i).finalize(n)}}}),r.algo={});return r}(Math);return t});
        },{}],"M95N":[function(require,module,exports) {
            var define;
            var t;!function(r,o){"object"==typeof exports?module.exports=exports=o(require("./core")):"function"==typeof t&&t.amd?t(["./core"],o):o(r.CryptoJS)}(this,function(t){var r,o,e,n,i;return o=(r=t).lib,e=o.Base,n=o.WordArray,(i=r.x64={}).Word=e.extend({init:function(t,r){this.high=t,this.low=r}}),i.WordArray=e.extend({init:function(t,r){t=this.words=t||[],this.sigBytes=null!=r?r:8*t.length},toX32:function(){for(var t=this.words,r=t.length,o=[],e=0;e<r;e++){var i=t[e];o.push(i.high),o.push(i.low)}return n.create(o,this.sigBytes)},clone:function(){for(var t=e.clone.call(this),r=t.words=this.words.slice(0),o=r.length,n=0;n<o;n++)r[n]=r[n].clone();return t}}),t});
        },{"./core":"eUTO"}],"X5QY":[function(require,module,exports) {
            var define;
            var r;!function(n,t){"object"==typeof exports?module.exports=exports=t(require("./core")):"function"==typeof r&&r.amd?r(["./core"],t):t(n.CryptoJS)}(this,function(r){return function(){if("function"==typeof ArrayBuffer){var n=r.lib.WordArray,t=n.init;(n.init=function(r){if(r instanceof ArrayBuffer&&(r=new Uint8Array(r)),(r instanceof Int8Array||"undefined"!=typeof Uint8ClampedArray&&r instanceof Uint8ClampedArray||r instanceof Int16Array||r instanceof Uint16Array||r instanceof Int32Array||r instanceof Uint32Array||r instanceof Float32Array||r instanceof Float64Array)&&(r=new Uint8Array(r.buffer,r.byteOffset,r.byteLength)),r instanceof Uint8Array){for(var n=r.byteLength,e=[],a=0;a<n;a++)e[a>>>2]|=r[a]<<24-a%4*8;t.call(this,e,n)}else t.apply(this,arguments)}).prototype=n}}(),r.lib.WordArray});
        },{"./core":"eUTO"}],"0xZK":[function(require,module,exports) {
            var define;
            var r;!function(t,n){"object"==typeof exports?module.exports=exports=n(require("./core")):"function"==typeof r&&r.amd?r(["./core"],n):n(t.CryptoJS)}(this,function(r){return function(){var t=r,n=t.lib.WordArray,o=t.enc;o.Utf16=o.Utf16BE={stringify:function(r){for(var t=r.words,n=r.sigBytes,o=[],e=0;e<n;e+=2){var f=t[e>>>2]>>>16-e%4*8&65535;o.push(String.fromCharCode(f))}return o.join("")},parse:function(r){for(var t=r.length,o=[],e=0;e<t;e++)o[e>>>1]|=r.charCodeAt(e)<<16-e%2*16;return n.create(o,2*t)}};function e(r){return r<<8&4278255360|r>>>8&16711935}o.Utf16LE={stringify:function(r){for(var t=r.words,n=r.sigBytes,o=[],f=0;f<n;f+=2){var i=e(t[f>>>2]>>>16-f%4*8&65535);o.push(String.fromCharCode(i))}return o.join("")},parse:function(r){for(var t=r.length,o=[],f=0;f<t;f++)o[f>>>1]|=e(r.charCodeAt(f)<<16-f%2*16);return n.create(o,2*t)}}}(),r.enc.Utf16});
        },{"./core":"eUTO"}],"/pJa":[function(require,module,exports) {
            var define;
            var r;!function(e,t){"object"==typeof exports?module.exports=exports=t(require("./core")):"function"==typeof r&&r.amd?r(["./core"],t):t(e.CryptoJS)}(this,function(r){return function(){var e=r,t=e.lib.WordArray;e.enc.Base64={stringify:function(r){var e=r.words,t=r.sigBytes,a=this._map;r.clamp();for(var o=[],n=0;n<t;n+=3)for(var i=(e[n>>>2]>>>24-n%4*8&255)<<16|(e[n+1>>>2]>>>24-(n+1)%4*8&255)<<8|e[n+2>>>2]>>>24-(n+2)%4*8&255,c=0;c<4&&n+.75*c<t;c++)o.push(a.charAt(i>>>6*(3-c)&63));var f=a.charAt(64);if(f)for(;o.length%4;)o.push(f);return o.join("")},parse:function(r){var e=r.length,a=this._map,o=this._reverseMap;if(!o){o=this._reverseMap=[];for(var n=0;n<a.length;n++)o[a.charCodeAt(n)]=n}var i=a.charAt(64);if(i){var c=r.indexOf(i);-1!==c&&(e=c)}return function(r,e,a){for(var o=[],n=0,i=0;i<e;i++)if(i%4){var c=a[r.charCodeAt(i-1)]<<i%4*2,f=a[r.charCodeAt(i)]>>>6-i%4*2;o[n>>>2]|=(c|f)<<24-n%4*8,n++}return t.create(o,n)}(r,e,o)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),r.enc.Base64});
        },{"./core":"eUTO"}],"GVDV":[function(require,module,exports) {
            var define;
            var r;!function(t,n){"object"==typeof exports?module.exports=exports=n(require("./core")):"function"==typeof r&&r.amd?r(["./core"],n):n(t.CryptoJS)}(this,function(r){return function(t){var n=r,e=n.lib,o=e.WordArray,a=e.Hasher,s=n.algo,i=[];!function(){for(var r=0;r<64;r++)i[r]=4294967296*t.abs(t.sin(r+1))|0}();var c=s.MD5=a.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(r,t){for(var n=0;n<16;n++){var e=t+n,o=r[e];r[e]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8)}var a=this._hash.words,s=r[t+0],c=r[t+1],l=r[t+2],_=r[t+3],d=r[t+4],p=r[t+5],y=r[t+6],D=r[t+7],H=r[t+8],M=r[t+9],g=r[t+10],m=r[t+11],w=r[t+12],x=r[t+13],B=r[t+14],b=r[t+15],j=a[0],k=a[1],q=a[2],z=a[3];j=h(j,k,q,z,s,7,i[0]),z=h(z,j,k,q,c,12,i[1]),q=h(q,z,j,k,l,17,i[2]),k=h(k,q,z,j,_,22,i[3]),j=h(j,k,q,z,d,7,i[4]),z=h(z,j,k,q,p,12,i[5]),q=h(q,z,j,k,y,17,i[6]),k=h(k,q,z,j,D,22,i[7]),j=h(j,k,q,z,H,7,i[8]),z=h(z,j,k,q,M,12,i[9]),q=h(q,z,j,k,g,17,i[10]),k=h(k,q,z,j,m,22,i[11]),j=h(j,k,q,z,w,7,i[12]),z=h(z,j,k,q,x,12,i[13]),q=h(q,z,j,k,B,17,i[14]),j=u(j,k=h(k,q,z,j,b,22,i[15]),q,z,c,5,i[16]),z=u(z,j,k,q,y,9,i[17]),q=u(q,z,j,k,m,14,i[18]),k=u(k,q,z,j,s,20,i[19]),j=u(j,k,q,z,p,5,i[20]),z=u(z,j,k,q,g,9,i[21]),q=u(q,z,j,k,b,14,i[22]),k=u(k,q,z,j,d,20,i[23]),j=u(j,k,q,z,M,5,i[24]),z=u(z,j,k,q,B,9,i[25]),q=u(q,z,j,k,_,14,i[26]),k=u(k,q,z,j,H,20,i[27]),j=u(j,k,q,z,x,5,i[28]),z=u(z,j,k,q,l,9,i[29]),q=u(q,z,j,k,D,14,i[30]),j=f(j,k=u(k,q,z,j,w,20,i[31]),q,z,p,4,i[32]),z=f(z,j,k,q,H,11,i[33]),q=f(q,z,j,k,m,16,i[34]),k=f(k,q,z,j,B,23,i[35]),j=f(j,k,q,z,c,4,i[36]),z=f(z,j,k,q,d,11,i[37]),q=f(q,z,j,k,D,16,i[38]),k=f(k,q,z,j,g,23,i[39]),j=f(j,k,q,z,x,4,i[40]),z=f(z,j,k,q,s,11,i[41]),q=f(q,z,j,k,_,16,i[42]),k=f(k,q,z,j,y,23,i[43]),j=f(j,k,q,z,M,4,i[44]),z=f(z,j,k,q,w,11,i[45]),q=f(q,z,j,k,b,16,i[46]),j=v(j,k=f(k,q,z,j,l,23,i[47]),q,z,s,6,i[48]),z=v(z,j,k,q,D,10,i[49]),q=v(q,z,j,k,B,15,i[50]),k=v(k,q,z,j,p,21,i[51]),j=v(j,k,q,z,w,6,i[52]),z=v(z,j,k,q,_,10,i[53]),q=v(q,z,j,k,g,15,i[54]),k=v(k,q,z,j,c,21,i[55]),j=v(j,k,q,z,H,6,i[56]),z=v(z,j,k,q,b,10,i[57]),q=v(q,z,j,k,y,15,i[58]),k=v(k,q,z,j,x,21,i[59]),j=v(j,k,q,z,d,6,i[60]),z=v(z,j,k,q,m,10,i[61]),q=v(q,z,j,k,l,15,i[62]),k=v(k,q,z,j,M,21,i[63]),a[0]=a[0]+j|0,a[1]=a[1]+k|0,a[2]=a[2]+q|0,a[3]=a[3]+z|0},_doFinalize:function(){var r=this._data,n=r.words,e=8*this._nDataBytes,o=8*r.sigBytes;n[o>>>5]|=128<<24-o%32;var a=t.floor(e/4294967296),s=e;n[15+(o+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),n[14+(o+64>>>9<<4)]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),r.sigBytes=4*(n.length+1),this._process();for(var i=this._hash,c=i.words,h=0;h<4;h++){var u=c[h];c[h]=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8)}return i},clone:function(){var r=a.clone.call(this);return r._hash=this._hash.clone(),r}});function h(r,t,n,e,o,a,s){var i=r+(t&n|~t&e)+o+s;return(i<<a|i>>>32-a)+t}function u(r,t,n,e,o,a,s){var i=r+(t&e|n&~e)+o+s;return(i<<a|i>>>32-a)+t}function f(r,t,n,e,o,a,s){var i=r+(t^n^e)+o+s;return(i<<a|i>>>32-a)+t}function v(r,t,n,e,o,a,s){var i=r+(n^(t|~e))+o+s;return(i<<a|i>>>32-a)+t}n.MD5=a._createHelper(c),n.HmacMD5=a._createHmacHelper(c)}(Math),r.MD5});
        },{"./core":"eUTO"}],"yxyM":[function(require,module,exports) {
            var define;
            var e;!function(t,r){"object"==typeof exports?module.exports=exports=r(require("./core")):"function"==typeof e&&e.amd?e(["./core"],r):r(t.CryptoJS)}(this,function(e){var t,r,o,s,a,n,i;return r=(t=e).lib,o=r.WordArray,s=r.Hasher,a=t.algo,n=[],i=a.SHA1=s.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var r=this._hash.words,o=r[0],s=r[1],a=r[2],i=r[3],h=r[4],c=0;c<80;c++){if(c<16)n[c]=0|e[t+c];else{var l=n[c-3]^n[c-8]^n[c-14]^n[c-16];n[c]=l<<1|l>>>31}var _=(o<<5|o>>>27)+h+n[c];_+=c<20?1518500249+(s&a|~s&i):c<40?1859775393+(s^a^i):c<60?(s&a|s&i|a&i)-1894007588:(s^a^i)-899497514,h=i,i=a,a=s<<30|s>>>2,s=o,o=_}r[0]=r[0]+o|0,r[1]=r[1]+s|0,r[2]=r[2]+a|0,r[3]=r[3]+i|0,r[4]=r[4]+h|0},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,o=8*e.sigBytes;return t[o>>>5]|=128<<24-o%32,t[14+(o+64>>>9<<4)]=Math.floor(r/4294967296),t[15+(o+64>>>9<<4)]=r,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=s.clone.call(this);return e._hash=this._hash.clone(),e}}),t.SHA1=s._createHelper(i),t.HmacSHA1=s._createHmacHelper(i),e.SHA1});
        },{"./core":"eUTO"}],"MS2N":[function(require,module,exports) {
            var define;
            var r;!function(t,e){"object"==typeof exports?module.exports=exports=e(require("./core")):"function"==typeof r&&r.amd?r(["./core"],e):e(t.CryptoJS)}(this,function(r){return function(t){var e=r,o=e.lib,n=o.WordArray,s=o.Hasher,i=e.algo,a=[],c=[];!function(){function r(r){for(var e=t.sqrt(r),o=2;o<=e;o++)if(!(r%o))return!1;return!0}function e(r){return 4294967296*(r-(0|r))|0}for(var o=2,n=0;n<64;)r(o)&&(n<8&&(a[n]=e(t.pow(o,.5))),c[n]=e(t.pow(o,1/3)),n++),o++}();var h=[],f=i.SHA256=s.extend({_doReset:function(){this._hash=new n.init(a.slice(0))},_doProcessBlock:function(r,t){for(var e=this._hash.words,o=e[0],n=e[1],s=e[2],i=e[3],a=e[4],f=e[5],u=e[6],l=e[7],_=0;_<64;_++){if(_<16)h[_]=0|r[t+_];else{var p=h[_-15],d=(p<<25|p>>>7)^(p<<14|p>>>18)^p>>>3,v=h[_-2],H=(v<<15|v>>>17)^(v<<13|v>>>19)^v>>>10;h[_]=d+h[_-7]+H+h[_-16]}var y=o&n^o&s^n&s,w=(o<<30|o>>>2)^(o<<19|o>>>13)^(o<<10|o>>>22),A=l+((a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25))+(a&f^~a&u)+c[_]+h[_];l=u,u=f,f=a,a=i+A|0,i=s,s=n,n=o,o=A+(w+y)|0}e[0]=e[0]+o|0,e[1]=e[1]+n|0,e[2]=e[2]+s|0,e[3]=e[3]+i|0,e[4]=e[4]+a|0,e[5]=e[5]+f|0,e[6]=e[6]+u|0,e[7]=e[7]+l|0},_doFinalize:function(){var r=this._data,e=r.words,o=8*this._nDataBytes,n=8*r.sigBytes;return e[n>>>5]|=128<<24-n%32,e[14+(n+64>>>9<<4)]=t.floor(o/4294967296),e[15+(n+64>>>9<<4)]=o,r.sigBytes=4*e.length,this._process(),this._hash},clone:function(){var r=s.clone.call(this);return r._hash=this._hash.clone(),r}});e.SHA256=s._createHelper(f),e.HmacSHA256=s._createHmacHelper(f)}(Math),r.SHA256});
        },{"./core":"eUTO"}],"OEnX":[function(require,module,exports) {
            var define;
            var e;!function(r,t,o){"object"==typeof exports?module.exports=exports=t(require("./core"),require("./sha256")):"function"==typeof e&&e.amd?e(["./core","./sha256"],t):t(r.CryptoJS)}(this,function(e){var r,t,o,i,n;return t=(r=e).lib.WordArray,o=r.algo,i=o.SHA256,n=o.SHA224=i.extend({_doReset:function(){this._hash=new t.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var e=i._doFinalize.call(this);return e.sigBytes-=4,e}}),r.SHA224=i._createHelper(n),r.HmacSHA224=i._createHmacHelper(n),e.SHA224});
        },{"./core":"eUTO","./sha256":"MS2N"}],"xA62":[function(require,module,exports) {
            var define;
            var i;!function(h,o,e){"object"==typeof exports?module.exports=exports=o(require("./core"),require("./x64-core")):"function"==typeof i&&i.amd?i(["./core","./x64-core"],o):o(h.CryptoJS)}(this,function(i){return function(){var h=i,o=h.lib.Hasher,e=h.x64,t=e.Word,n=e.WordArray,r=h.algo;function l(){return t.create.apply(t,arguments)}var a=[l(1116352408,3609767458),l(1899447441,602891725),l(3049323471,3964484399),l(3921009573,2173295548),l(961987163,4081628472),l(1508970993,3053834265),l(2453635748,2937671579),l(2870763221,3664609560),l(3624381080,2734883394),l(310598401,1164996542),l(607225278,1323610764),l(1426881987,3590304994),l(1925078388,4068182383),l(2162078206,991336113),l(2614888103,633803317),l(3248222580,3479774868),l(3835390401,2666613458),l(4022224774,944711139),l(264347078,2341262773),l(604807628,2007800933),l(770255983,1495990901),l(1249150122,1856431235),l(1555081692,3175218132),l(1996064986,2198950837),l(2554220882,3999719339),l(2821834349,766784016),l(2952996808,2566594879),l(3210313671,3203337956),l(3336571891,1034457026),l(3584528711,2466948901),l(113926993,3758326383),l(338241895,168717936),l(666307205,1188179964),l(773529912,1546045734),l(1294757372,1522805485),l(1396182291,2643833823),l(1695183700,2343527390),l(1986661051,1014477480),l(2177026350,1206759142),l(2456956037,344077627),l(2730485921,1290863460),l(2820302411,3158454273),l(3259730800,3505952657),l(3345764771,106217008),l(3516065817,3606008344),l(3600352804,1432725776),l(4094571909,1467031594),l(275423344,851169720),l(430227734,3100823752),l(506948616,1363258195),l(659060556,3750685593),l(883997877,3785050280),l(958139571,3318307427),l(1322822218,3812723403),l(1537002063,2003034995),l(1747873779,3602036899),l(1955562222,1575990012),l(2024104815,1125592928),l(2227730452,2716904306),l(2361852424,442776044),l(2428436474,593698344),l(2756734187,3733110249),l(3204031479,2999351573),l(3329325298,3815920427),l(3391569614,3928383900),l(3515267271,566280711),l(3940187606,3454069534),l(4118630271,4000239992),l(116418474,1914138554),l(174292421,2731055270),l(289380356,3203993006),l(460393269,320620315),l(685471733,587496836),l(852142971,1086792851),l(1017036298,365543100),l(1126000580,2618297676),l(1288033470,3409855158),l(1501505948,4234509866),l(1607167915,987167468),l(1816402316,1246189591)],w=[];!function(){for(var i=0;i<80;i++)w[i]=l()}();var s=r.SHA512=o.extend({_doReset:function(){this._hash=new n.init([new t.init(1779033703,4089235720),new t.init(3144134277,2227873595),new t.init(1013904242,4271175723),new t.init(2773480762,1595750129),new t.init(1359893119,2917565137),new t.init(2600822924,725511199),new t.init(528734635,4215389547),new t.init(1541459225,327033209)])},_doProcessBlock:function(i,h){for(var o=this._hash.words,e=o[0],t=o[1],n=o[2],r=o[3],l=o[4],s=o[5],c=o[6],g=o[7],u=e.high,f=e.low,_=t.high,v=t.low,d=n.high,p=n.low,H=r.high,y=r.low,x=l.high,S=l.low,A=s.high,m=s.low,B=c.high,b=c.low,k=g.high,q=g.low,z=u,W=f,j=_,C=v,D=d,F=p,J=H,M=y,P=x,R=S,X=A,E=m,G=B,I=b,K=k,L=q,N=0;N<80;N++){var O=w[N];if(N<16)var Q=O.high=0|i[h+2*N],T=O.low=0|i[h+2*N+1];else{var U=w[N-15],V=U.high,Y=U.low,Z=(V>>>1|Y<<31)^(V>>>8|Y<<24)^V>>>7,$=(Y>>>1|V<<31)^(Y>>>8|V<<24)^(Y>>>7|V<<25),ii=w[N-2],hi=ii.high,oi=ii.low,ei=(hi>>>19|oi<<13)^(hi<<3|oi>>>29)^hi>>>6,ti=(oi>>>19|hi<<13)^(oi<<3|hi>>>29)^(oi>>>6|hi<<26),ni=w[N-7],ri=ni.high,li=ni.low,ai=w[N-16],wi=ai.high,si=ai.low;Q=(Q=(Q=Z+ri+((T=$+li)>>>0<$>>>0?1:0))+ei+((T=T+ti)>>>0<ti>>>0?1:0))+wi+((T=T+si)>>>0<si>>>0?1:0);O.high=Q,O.low=T}var ci,gi=P&X^~P&G,ui=R&E^~R&I,fi=z&j^z&D^j&D,_i=W&C^W&F^C&F,vi=(z>>>28|W<<4)^(z<<30|W>>>2)^(z<<25|W>>>7),di=(W>>>28|z<<4)^(W<<30|z>>>2)^(W<<25|z>>>7),pi=(P>>>14|R<<18)^(P>>>18|R<<14)^(P<<23|R>>>9),Hi=(R>>>14|P<<18)^(R>>>18|P<<14)^(R<<23|P>>>9),yi=a[N],xi=yi.high,Si=yi.low,Ai=K+pi+((ci=L+Hi)>>>0<L>>>0?1:0),mi=di+_i;K=G,L=I,G=X,I=E,X=P,E=R,P=J+(Ai=(Ai=(Ai=Ai+gi+((ci=ci+ui)>>>0<ui>>>0?1:0))+xi+((ci=ci+Si)>>>0<Si>>>0?1:0))+Q+((ci=ci+T)>>>0<T>>>0?1:0))+((R=M+ci|0)>>>0<M>>>0?1:0)|0,J=D,M=F,D=j,F=C,j=z,C=W,z=Ai+(vi+fi+(mi>>>0<di>>>0?1:0))+((W=ci+mi|0)>>>0<ci>>>0?1:0)|0}f=e.low=f+W,e.high=u+z+(f>>>0<W>>>0?1:0),v=t.low=v+C,t.high=_+j+(v>>>0<C>>>0?1:0),p=n.low=p+F,n.high=d+D+(p>>>0<F>>>0?1:0),y=r.low=y+M,r.high=H+J+(y>>>0<M>>>0?1:0),S=l.low=S+R,l.high=x+P+(S>>>0<R>>>0?1:0),m=s.low=m+E,s.high=A+X+(m>>>0<E>>>0?1:0),b=c.low=b+I,c.high=B+G+(b>>>0<I>>>0?1:0),q=g.low=q+L,g.high=k+K+(q>>>0<L>>>0?1:0)},_doFinalize:function(){var i=this._data,h=i.words,o=8*this._nDataBytes,e=8*i.sigBytes;return h[e>>>5]|=128<<24-e%32,h[30+(e+128>>>10<<5)]=Math.floor(o/4294967296),h[31+(e+128>>>10<<5)]=o,i.sigBytes=4*h.length,this._process(),this._hash.toX32()},clone:function(){var i=o.clone.call(this);return i._hash=this._hash.clone(),i},blockSize:32});h.SHA512=o._createHelper(s),h.HmacSHA512=o._createHmacHelper(s)}(),i.SHA512});
        },{"./core":"eUTO","./x64-core":"M95N"}],"YkB8":[function(require,module,exports) {
            var define;
            var e;!function(i,n,t){"object"==typeof exports?module.exports=exports=n(require("./core"),require("./x64-core"),require("./sha512")):"function"==typeof e&&e.amd?e(["./core","./x64-core","./sha512"],n):n(i.CryptoJS)}(this,function(e){var i,n,t,r,o,a,c;return n=(i=e).x64,t=n.Word,r=n.WordArray,o=i.algo,a=o.SHA512,c=o.SHA384=a.extend({_doReset:function(){this._hash=new r.init([new t.init(3418070365,3238371032),new t.init(1654270250,914150663),new t.init(2438529370,812702999),new t.init(355462360,4144912697),new t.init(1731405415,4290775857),new t.init(2394180231,1750603025),new t.init(3675008525,1694076839),new t.init(1203062813,3204075428)])},_doFinalize:function(){var e=a._doFinalize.call(this);return e.sigBytes-=16,e}}),i.SHA384=a._createHelper(c),i.HmacSHA384=a._createHmacHelper(c),e.SHA384});
        },{"./core":"eUTO","./x64-core":"M95N","./sha512":"xA62"}],"F6e3":[function(require,module,exports) {
            var define;
            var r;!function(o,t,e){"object"==typeof exports?module.exports=exports=t(require("./core"),require("./x64-core")):"function"==typeof r&&r.amd?r(["./core","./x64-core"],t):t(o.CryptoJS)}(this,function(r){return function(o){var t=r,e=t.lib,i=e.WordArray,h=e.Hasher,a=t.x64.Word,n=t.algo,s=[],c=[],f=[];!function(){for(var r=1,o=0,t=0;t<24;t++){s[r+5*o]=(t+1)*(t+2)/2%64;var e=(2*r+3*o)%5;r=o%5,o=e}for(r=0;r<5;r++)for(o=0;o<5;o++)c[r+5*o]=o+(2*r+3*o)%5*5;for(var i=1,h=0;h<24;h++){for(var n=0,l=0,g=0;g<7;g++){if(1&i){var v=(1<<g)-1;v<32?l^=1<<v:n^=1<<v-32}128&i?i=i<<1^113:i<<=1}f[h]=a.create(n,l)}}();var l=[];!function(){for(var r=0;r<25;r++)l[r]=a.create()}();var g=n.SHA3=h.extend({cfg:h.cfg.extend({outputLength:512}),_doReset:function(){for(var r=this._state=[],o=0;o<25;o++)r[o]=new a.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(r,o){for(var t=this._state,e=this.blockSize/2,i=0;i<e;i++){var h=r[o+2*i],a=r[o+2*i+1];h=16711935&(h<<8|h>>>24)|4278255360&(h<<24|h>>>8),a=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),(B=t[i]).high^=a,B.low^=h}for(var n=0;n<24;n++){for(var g=0;g<5;g++){for(var v=0,u=0,w=0;w<5;w++){v^=(B=t[g+5*w]).high,u^=B.low}var p=l[g];p.high=v,p.low=u}for(g=0;g<5;g++){var _=l[(g+4)%5],d=l[(g+1)%5],H=d.high,x=d.low;for(v=_.high^(H<<1|x>>>31),u=_.low^(x<<1|H>>>31),w=0;w<5;w++){(B=t[g+5*w]).high^=v,B.low^=u}}for(var S=1;S<25;S++){var y=(B=t[S]).high,b=B.low,A=s[S];if(A<32)v=y<<A|b>>>32-A,u=b<<A|y>>>32-A;else v=b<<A-32|y>>>64-A,u=y<<A-32|b>>>64-A;var k=l[c[S]];k.high=v,k.low=u}var m=l[0],z=t[0];m.high=z.high,m.low=z.low;for(g=0;g<5;g++)for(w=0;w<5;w++){var B=t[S=g+5*w],L=l[S],q=l[(g+1)%5+5*w],W=l[(g+2)%5+5*w];B.high=L.high^~q.high&W.high,B.low=L.low^~q.low&W.low}B=t[0];var j=f[n];B.high^=j.high,B.low^=j.low}},_doFinalize:function(){var r=this._data,t=r.words,e=(this._nDataBytes,8*r.sigBytes),h=32*this.blockSize;t[e>>>5]|=1<<24-e%32,t[(o.ceil((e+1)/h)*h>>>5)-1]|=128,r.sigBytes=4*t.length,this._process();for(var a=this._state,n=this.cfg.outputLength/8,s=n/8,c=[],f=0;f<s;f++){var l=a[f],g=l.high,v=l.low;g=16711935&(g<<8|g>>>24)|4278255360&(g<<24|g>>>8),v=16711935&(v<<8|v>>>24)|4278255360&(v<<24|v>>>8),c.push(v),c.push(g)}return new i.init(c,n)},clone:function(){for(var r=h.clone.call(this),o=r._state=this._state.slice(0),t=0;t<25;t++)o[t]=o[t].clone();return r}});t.SHA3=h._createHelper(g),t.HmacSHA3=h._createHmacHelper(g)}(Math),r.SHA3});
        },{"./core":"eUTO","./x64-core":"M95N"}],"Y8c+":[function(require,module,exports) {
            var define;
            var r;!function(e,t){"object"==typeof exports?module.exports=exports=t(require("./core")):"function"==typeof r&&r.amd?r(["./core"],t):t(e.CryptoJS)}(this,function(r){return function(e){var t=r,o=t.lib,n=o.WordArray,s=o.Hasher,a=t.algo,c=n.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),i=n.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),u=n.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),h=n.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),f=n.create([0,1518500249,1859775393,2400959708,2840853838]),d=n.create([1352829926,1548603684,1836072691,2053994217,0]),l=a.RIPEMD160=s.extend({_doReset:function(){this._hash=n.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(r,e){for(var t=0;t<16;t++){var o=e+t,n=r[o];r[o]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8)}var s,a,l,H,M,P,R,g,m,x,B,E=this._hash.words,I=f.words,b=d.words,j=c.words,k=i.words,q=u.words,z=h.words;P=s=E[0],R=a=E[1],g=l=E[2],m=H=E[3],x=M=E[4];for(t=0;t<80;t+=1)B=s+r[e+j[t]]|0,B+=t<16?_(a,l,H)+I[0]:t<32?p(a,l,H)+I[1]:t<48?v(a,l,H)+I[2]:t<64?w(a,l,H)+I[3]:y(a,l,H)+I[4],B=(B=D(B|=0,q[t]))+M|0,s=M,M=H,H=D(l,10),l=a,a=B,B=P+r[e+k[t]]|0,B+=t<16?y(R,g,m)+b[0]:t<32?w(R,g,m)+b[1]:t<48?v(R,g,m)+b[2]:t<64?p(R,g,m)+b[3]:_(R,g,m)+b[4],B=(B=D(B|=0,z[t]))+x|0,P=x,x=m,m=D(g,10),g=R,R=B;B=E[1]+l+m|0,E[1]=E[2]+H+x|0,E[2]=E[3]+M+P|0,E[3]=E[4]+s+R|0,E[4]=E[0]+a+g|0,E[0]=B},_doFinalize:function(){var r=this._data,e=r.words,t=8*this._nDataBytes,o=8*r.sigBytes;e[o>>>5]|=128<<24-o%32,e[14+(o+64>>>9<<4)]=16711935&(t<<8|t>>>24)|4278255360&(t<<24|t>>>8),r.sigBytes=4*(e.length+1),this._process();for(var n=this._hash,s=n.words,a=0;a<5;a++){var c=s[a];s[a]=16711935&(c<<8|c>>>24)|4278255360&(c<<24|c>>>8)}return n},clone:function(){var r=s.clone.call(this);return r._hash=this._hash.clone(),r}});function _(r,e,t){return r^e^t}function p(r,e,t){return r&e|~r&t}function v(r,e,t){return(r|~e)^t}function w(r,e,t){return r&t|e&~t}function y(r,e,t){return r^(e|~t)}function D(r,e){return r<<e|r>>>32-e}t.RIPEMD160=s._createHelper(l),t.HmacRIPEMD160=s._createHmacHelper(l)}(Math),r.RIPEMD160});
        },{"./core":"eUTO"}],"IKo8":[function(require,module,exports) {
            var define;
            var e;!function(t,i){"object"==typeof exports?module.exports=exports=i(require("./core")):"function"==typeof e&&e.amd?e(["./core"],i):i(t.CryptoJS)}(this,function(e){var t,i,s;i=(t=e).lib.Base,s=t.enc.Utf8,t.algo.HMAC=i.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=s.parse(t));var i=e.blockSize,r=4*i;t.sigBytes>r&&(t=e.finalize(t)),t.clamp();for(var n=this._oKey=t.clone(),o=this._iKey=t.clone(),a=n.words,h=o.words,c=0;c<i;c++)a[c]^=1549556828,h[c]^=909522486;n.sigBytes=o.sigBytes=r,this.reset()},reset:function(){var e=this._hasher;e.reset(),e.update(this._iKey)},update:function(e){return this._hasher.update(e),this},finalize:function(e){var t=this._hasher,i=t.finalize(e);return t.reset(),t.finalize(this._oKey.clone().concat(i))}})});
        },{"./core":"eUTO"}],"/NfQ":[function(require,module,exports) {
            var define;
            var e;!function(r,t,o){"object"==typeof exports?module.exports=exports=t(require("./core"),require("./sha1"),require("./hmac")):"function"==typeof e&&e.amd?e(["./core","./sha1","./hmac"],t):t(r.CryptoJS)}(this,function(e){var r,t,o,i,a,n,c,s;return t=(r=e).lib,o=t.Base,i=t.WordArray,a=r.algo,n=a.SHA1,c=a.HMAC,s=a.PBKDF2=o.extend({cfg:o.extend({keySize:4,hasher:n,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,r){for(var t=this.cfg,o=c.create(t.hasher,e),a=i.create(),n=i.create([1]),s=a.words,f=n.words,u=t.keySize,h=t.iterations;s.length<u;){var d=o.update(r).finalize(n);o.reset();for(var p=d.words,g=p.length,l=d,y=1;y<h;y++){l=o.finalize(l),o.reset();for(var m=l.words,v=0;v<g;v++)p[v]^=m[v]}a.concat(d),f[0]++}return a.sigBytes=4*u,a}}),r.PBKDF2=function(e,r,t){return s.create(t).compute(e,r)},e.PBKDF2});
        },{"./core":"eUTO","./sha1":"yxyM","./hmac":"IKo8"}],"W9aa":[function(require,module,exports) {
            var define;
            var e;!function(t,r,i){"object"==typeof exports?module.exports=exports=r(require("./core"),require("./sha1"),require("./hmac")):"function"==typeof e&&e.amd?e(["./core","./sha1","./hmac"],r):r(t.CryptoJS)}(this,function(e){var t,r,i,o,a,n,c;return r=(t=e).lib,i=r.Base,o=r.WordArray,a=t.algo,n=a.MD5,c=a.EvpKDF=i.extend({cfg:i.extend({keySize:4,hasher:n,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var r=this.cfg,i=r.hasher.create(),a=o.create(),n=a.words,c=r.keySize,s=r.iterations;n.length<c;){u&&i.update(u);var u=i.update(e).finalize(t);i.reset();for(var f=1;f<s;f++)u=i.finalize(u),i.reset();a.concat(u)}return a.sigBytes=4*c,a}}),t.EvpKDF=function(e,t,r){return c.create(r).compute(e,t)},e.EvpKDF});
        },{"./core":"eUTO","./sha1":"yxyM","./hmac":"IKo8"}],"uCLB":[function(require,module,exports) {
            var define;
            var e;!function(t,r,i){"object"==typeof exports?module.exports=exports=r(require("./core"),require("./evpkdf")):"function"==typeof e&&e.amd?e(["./core","./evpkdf"],r):r(t.CryptoJS)}(this,function(e){e.lib.Cipher||function(t){var r=e,i=r.lib,n=i.Base,c=i.WordArray,o=i.BufferedBlockAlgorithm,s=r.enc,a=(s.Utf8,s.Base64),f=r.algo.EvpKDF,p=i.Cipher=o.extend({cfg:n.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,r){this.cfg=this.cfg.extend(r),this._xformMode=e,this._key=t,this.reset()},reset:function(){o.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function e(e){return"string"==typeof e?x:v}return function(t){return{encrypt:function(r,i,n){return e(i).encrypt(t,r,i,n)},decrypt:function(r,i,n){return e(i).decrypt(t,r,i,n)}}}}()}),h=(i.StreamCipher=p.extend({_doFinalize:function(){return this._process(!0)},blockSize:1}),r.mode={}),d=i.BlockCipherMode=n.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}}),u=h.CBC=function(){var e=d.extend();function r(e,r,i){var n=this._iv;if(n){var c=n;this._iv=t}else c=this._prevBlock;for(var o=0;o<i;o++)e[r+o]^=c[o]}return e.Encryptor=e.extend({processBlock:function(e,t){var i=this._cipher,n=i.blockSize;r.call(this,e,t,n),i.encryptBlock(e,t),this._prevBlock=e.slice(t,t+n)}}),e.Decryptor=e.extend({processBlock:function(e,t){var i=this._cipher,n=i.blockSize,c=e.slice(t,t+n);i.decryptBlock(e,t),r.call(this,e,t,n),this._prevBlock=c}}),e}(),l=(r.pad={}).Pkcs7={pad:function(e,t){for(var r=4*t,i=r-e.sigBytes%r,n=i<<24|i<<16|i<<8|i,o=[],s=0;s<i;s+=4)o.push(n);var a=c.create(o,i);e.concat(a)},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},_=(i.BlockCipher=p.extend({cfg:p.cfg.extend({mode:u,padding:l}),reset:function(){p.reset.call(this);var e=this.cfg,t=e.iv,r=e.mode;if(this._xformMode==this._ENC_XFORM_MODE)var i=r.createEncryptor;else{i=r.createDecryptor;this._minBufferSize=1}this._mode&&this._mode.__creator==i?this._mode.init(this,t&&t.words):(this._mode=i.call(r,this,t&&t.words),this._mode.__creator=i)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){e.pad(this._data,this.blockSize);var t=this._process(!0)}else{t=this._process(!0);e.unpad(t)}return t},blockSize:4}),i.CipherParams=n.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}})),y=(r.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext,r=e.salt;if(r)var i=c.create([1398893684,1701076831]).concat(r).concat(t);else i=t;return i.toString(a)},parse:function(e){var t=a.parse(e),r=t.words;if(1398893684==r[0]&&1701076831==r[1]){var i=c.create(r.slice(2,4));r.splice(0,4),t.sigBytes-=16}return _.create({ciphertext:t,salt:i})}},v=i.SerializableCipher=n.extend({cfg:n.extend({format:y}),encrypt:function(e,t,r,i){i=this.cfg.extend(i);var n=e.createEncryptor(r,i),c=n.finalize(t),o=n.cfg;return _.create({ciphertext:c,key:r,iv:o.iv,algorithm:e,mode:o.mode,padding:o.padding,blockSize:e.blockSize,formatter:i.format})},decrypt:function(e,t,r,i){return i=this.cfg.extend(i),t=this._parse(t,i.format),e.createDecryptor(r,i).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),k=(r.kdf={}).OpenSSL={execute:function(e,t,r,i){i||(i=c.random(8));var n=f.create({keySize:t+r}).compute(e,i),o=c.create(n.words.slice(t),4*r);return n.sigBytes=4*t,_.create({key:n,iv:o,salt:i})}},x=i.PasswordBasedCipher=v.extend({cfg:v.cfg.extend({kdf:k}),encrypt:function(e,t,r,i){var n=(i=this.cfg.extend(i)).kdf.execute(r,e.keySize,e.ivSize);i.iv=n.iv;var c=v.encrypt.call(this,e,t,n.key,i);return c.mixIn(n),c},decrypt:function(e,t,r,i){i=this.cfg.extend(i),t=this._parse(t,i.format);var n=i.kdf.execute(r,e.keySize,e.ivSize,t.salt);return i.iv=n.iv,v.decrypt.call(this,e,t,n.key,i)}})}()});
        },{"./core":"eUTO","./evpkdf":"W9aa"}],"dnNm":[function(require,module,exports) {
            var define;
            var e;!function(r,o,c){"object"==typeof exports?module.exports=exports=o(require("./core"),require("./cipher-core")):"function"==typeof e&&e.amd?e(["./core","./cipher-core"],o):o(r.CryptoJS)}(this,function(e){return e.mode.CFB=function(){var r=e.lib.BlockCipherMode.extend();function o(e,r,o,c){var i=this._iv;if(i){var t=i.slice(0);this._iv=void 0}else t=this._prevBlock;c.encryptBlock(t,0);for(var n=0;n<o;n++)e[r+n]^=t[n]}return r.Encryptor=r.extend({processBlock:function(e,r){var c=this._cipher,i=c.blockSize;o.call(this,e,r,i,c),this._prevBlock=e.slice(r,r+i)}}),r.Decryptor=r.extend({processBlock:function(e,r){var c=this._cipher,i=c.blockSize,t=e.slice(r,r+i);o.call(this,e,r,i,c),this._prevBlock=t}}),r}(),e.mode.CFB});
        },{"./core":"eUTO","./cipher-core":"uCLB"}],"iAFA":[function(require,module,exports) {
            var define;
            var e;!function(r,o,t){"object"==typeof exports?module.exports=exports=o(require("./core"),require("./cipher-core")):"function"==typeof e&&e.amd?e(["./core","./cipher-core"],o):o(r.CryptoJS)}(this,function(e){var r,o;return e.mode.CTR=(r=e.lib.BlockCipherMode.extend(),o=r.Encryptor=r.extend({processBlock:function(e,r){var o=this._cipher,t=o.blockSize,c=this._iv,i=this._counter;c&&(i=this._counter=c.slice(0),this._iv=void 0);var n=i.slice(0);o.encryptBlock(n,0),i[t-1]=i[t-1]+1|0;for(var p=0;p<t;p++)e[r+p]^=n[p]}}),r.Decryptor=o,r),e.mode.CTR});
        },{"./core":"eUTO","./cipher-core":"uCLB"}],"Oy1Y":[function(require,module,exports) {
            var define;
            var e;!function(r,o,t){"object"==typeof exports?module.exports=exports=o(require("./core"),require("./cipher-core")):"function"==typeof e&&e.amd?e(["./core","./cipher-core"],o):o(r.CryptoJS)}(this,function(e){return e.mode.CTRGladman=function(){var r=e.lib.BlockCipherMode.extend();function o(e){if(255==(e>>24&255)){var r=e>>16&255,o=e>>8&255,t=255&e;255===r?(r=0,255===o?(o=0,255===t?t=0:++t):++o):++r,e=0,e+=r<<16,e+=o<<8,e+=t}else e+=1<<24;return e}var t=r.Encryptor=r.extend({processBlock:function(e,r){var t=this._cipher,c=t.blockSize,i=this._iv,n=this._counter;i&&(n=this._counter=i.slice(0),this._iv=void 0),function(e){0===(e[0]=o(e[0]))&&(e[1]=o(e[1]))}(n);var u=n.slice(0);t.encryptBlock(u,0);for(var p=0;p<c;p++)e[r+p]^=u[p]}});return r.Decryptor=t,r}(),e.mode.CTRGladman});
        },{"./core":"eUTO","./cipher-core":"uCLB"}],"/HXd":[function(require,module,exports) {
            var define;
            var e;!function(r,o,t){"object"==typeof exports?module.exports=exports=o(require("./core"),require("./cipher-core")):"function"==typeof e&&e.amd?e(["./core","./cipher-core"],o):o(r.CryptoJS)}(this,function(e){var r,o;return e.mode.OFB=(r=e.lib.BlockCipherMode.extend(),o=r.Encryptor=r.extend({processBlock:function(e,r){var o=this._cipher,t=o.blockSize,i=this._iv,c=this._keystream;i&&(c=this._keystream=i.slice(0),this._iv=void 0),o.encryptBlock(c,0);for(var p=0;p<t;p++)e[r+p]^=c[p]}}),r.Decryptor=o,r),e.mode.OFB});
        },{"./core":"eUTO","./cipher-core":"uCLB"}],"QDS2":[function(require,module,exports) {
            var define;
            var e;!function(o,r,c){"object"==typeof exports?module.exports=exports=r(require("./core"),require("./cipher-core")):"function"==typeof e&&e.amd?e(["./core","./cipher-core"],r):r(o.CryptoJS)}(this,function(e){var o;return e.mode.ECB=((o=e.lib.BlockCipherMode.extend()).Encryptor=o.extend({processBlock:function(e,o){this._cipher.encryptBlock(e,o)}}),o.Decryptor=o.extend({processBlock:function(e,o){this._cipher.decryptBlock(e,o)}}),o),e.mode.ECB});
        },{"./core":"eUTO","./cipher-core":"uCLB"}],"1Hi7":[function(require,module,exports) {
            var define;
            var e;!function(r,o,t){"object"==typeof exports?module.exports=exports=o(require("./core"),require("./cipher-core")):"function"==typeof e&&e.amd?e(["./core","./cipher-core"],o):o(r.CryptoJS)}(this,function(e){return e.pad.AnsiX923={pad:function(e,r){var o=e.sigBytes,t=4*r,i=t-o%t,s=o+i-1;e.clamp(),e.words[s>>>2]|=i<<24-s%4*8,e.sigBytes+=i},unpad:function(e){var r=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=r}},e.pad.Ansix923});
        },{"./core":"eUTO","./cipher-core":"uCLB"}],"HttL":[function(require,module,exports) {
            var define;
            var r;!function(o,e,t){"object"==typeof exports?module.exports=exports=e(require("./core"),require("./cipher-core")):"function"==typeof r&&r.amd?r(["./core","./cipher-core"],e):e(o.CryptoJS)}(this,function(r){return r.pad.Iso10126={pad:function(o,e){var t=4*e,c=t-o.sigBytes%t;o.concat(r.lib.WordArray.random(c-1)).concat(r.lib.WordArray.create([c<<24],1))},unpad:function(r){var o=255&r.words[r.sigBytes-1>>>2];r.sigBytes-=o}},r.pad.Iso10126});
        },{"./core":"eUTO","./cipher-core":"uCLB"}],"letQ":[function(require,module,exports) {
            var define;
            var e;!function(o,r,t){"object"==typeof exports?module.exports=exports=r(require("./core"),require("./cipher-core")):"function"==typeof e&&e.amd?e(["./core","./cipher-core"],r):r(o.CryptoJS)}(this,function(e){return e.pad.Iso97971={pad:function(o,r){o.concat(e.lib.WordArray.create([2147483648],1)),e.pad.ZeroPadding.pad(o,r)},unpad:function(o){e.pad.ZeroPadding.unpad(o),o.sigBytes--}},e.pad.Iso97971});
        },{"./core":"eUTO","./cipher-core":"uCLB"}],"aieV":[function(require,module,exports) {
            var define;
            var e;!function(r,o,t){"object"==typeof exports?module.exports=exports=o(require("./core"),require("./cipher-core")):"function"==typeof e&&e.amd?e(["./core","./cipher-core"],o):o(r.CryptoJS)}(this,function(e){return e.pad.ZeroPadding={pad:function(e,r){var o=4*r;e.clamp(),e.sigBytes+=o-(e.sigBytes%o||o)},unpad:function(e){for(var r=e.words,o=e.sigBytes-1;!(r[o>>>2]>>>24-o%4*8&255);)o--;e.sigBytes=o+1}},e.pad.ZeroPadding});
        },{"./core":"eUTO","./cipher-core":"uCLB"}],"GO8Y":[function(require,module,exports) {
            var define;
            var o;!function(e,r,n){"object"==typeof exports?module.exports=exports=r(require("./core"),require("./cipher-core")):"function"==typeof o&&o.amd?o(["./core","./cipher-core"],r):r(e.CryptoJS)}(this,function(o){return o.pad.NoPadding={pad:function(){},unpad:function(){}},o.pad.NoPadding});
        },{"./core":"eUTO","./cipher-core":"uCLB"}],"vtW7":[function(require,module,exports) {
            var define;
            var r;!function(e,t,o){"object"==typeof exports?module.exports=exports=t(require("./core"),require("./cipher-core")):"function"==typeof r&&r.amd?r(["./core","./cipher-core"],t):t(e.CryptoJS)}(this,function(r){var e,t,o;return t=(e=r).lib.CipherParams,o=e.enc.Hex,e.format.Hex={stringify:function(r){return r.ciphertext.toString(o)},parse:function(r){var e=o.parse(r);return t.create({ciphertext:e})}},r.format.Hex});
        },{"./core":"eUTO","./cipher-core":"uCLB"}],"Srb3":[function(require,module,exports) {
            var define;
            var e;!function(r,o,t){"object"==typeof exports?module.exports=exports=o(require("./core"),require("./enc-base64"),require("./md5"),require("./evpkdf"),require("./cipher-core")):"function"==typeof e&&e.amd?e(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],o):o(r.CryptoJS)}(this,function(e){return function(){var r=e,o=r.lib.BlockCipher,t=r.algo,i=[],c=[],n=[],s=[],u=[],f=[],h=[],d=[],a=[],y=[];!function(){for(var e=[],r=0;r<256;r++)e[r]=r<128?r<<1:r<<1^283;var o=0,t=0;for(r=0;r<256;r++){var p=t^t<<1^t<<2^t<<3^t<<4;p=p>>>8^255&p^99,i[o]=p,c[p]=o;var v=e[o],l=e[v],_=e[l],k=257*e[p]^16843008*p;n[o]=k<<24|k>>>8,s[o]=k<<16|k>>>16,u[o]=k<<8|k>>>24,f[o]=k;k=16843009*_^65537*l^257*v^16843008*o;h[p]=k<<24|k>>>8,d[p]=k<<16|k>>>16,a[p]=k<<8|k>>>24,y[p]=k,o?(o=v^e[e[e[_^v]]],t^=e[e[t]]):o=t=1}}();var p=[0,1,2,4,8,16,32,64,128,27,54],v=t.AES=o.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,r=e.words,o=e.sigBytes/4,t=4*((this._nRounds=o+6)+1),c=this._keySchedule=[],n=0;n<t;n++)if(n<o)c[n]=r[n];else{var s=c[n-1];n%o?o>6&&n%o==4&&(s=i[s>>>24]<<24|i[s>>>16&255]<<16|i[s>>>8&255]<<8|i[255&s]):(s=i[(s=s<<8|s>>>24)>>>24]<<24|i[s>>>16&255]<<16|i[s>>>8&255]<<8|i[255&s],s^=p[n/o|0]<<24),c[n]=c[n-o]^s}for(var u=this._invKeySchedule=[],f=0;f<t;f++){n=t-f;if(f%4)s=c[n];else s=c[n-4];u[f]=f<4||n<=4?s:h[i[s>>>24]]^d[i[s>>>16&255]]^a[i[s>>>8&255]]^y[i[255&s]]}}},encryptBlock:function(e,r){this._doCryptBlock(e,r,this._keySchedule,n,s,u,f,i)},decryptBlock:function(e,r){var o=e[r+1];e[r+1]=e[r+3],e[r+3]=o,this._doCryptBlock(e,r,this._invKeySchedule,h,d,a,y,c);o=e[r+1];e[r+1]=e[r+3],e[r+3]=o},_doCryptBlock:function(e,r,o,t,i,c,n,s){for(var u=this._nRounds,f=e[r]^o[0],h=e[r+1]^o[1],d=e[r+2]^o[2],a=e[r+3]^o[3],y=4,p=1;p<u;p++){var v=t[f>>>24]^i[h>>>16&255]^c[d>>>8&255]^n[255&a]^o[y++],l=t[h>>>24]^i[d>>>16&255]^c[a>>>8&255]^n[255&f]^o[y++],_=t[d>>>24]^i[a>>>16&255]^c[f>>>8&255]^n[255&h]^o[y++],k=t[a>>>24]^i[f>>>16&255]^c[h>>>8&255]^n[255&d]^o[y++];f=v,h=l,d=_,a=k}v=(s[f>>>24]<<24|s[h>>>16&255]<<16|s[d>>>8&255]<<8|s[255&a])^o[y++],l=(s[h>>>24]<<24|s[d>>>16&255]<<16|s[a>>>8&255]<<8|s[255&f])^o[y++],_=(s[d>>>24]<<24|s[a>>>16&255]<<16|s[f>>>8&255]<<8|s[255&h])^o[y++],k=(s[a>>>24]<<24|s[f>>>16&255]<<16|s[h>>>8&255]<<8|s[255&d])^o[y++];e[r]=v,e[r+1]=l,e[r+2]=_,e[r+3]=k},keySize:8});r.AES=o._createHelper(v)}(),e.AES});
        },{"./core":"eUTO","./enc-base64":"/pJa","./md5":"GVDV","./evpkdf":"W9aa","./cipher-core":"uCLB"}],"ySCI":[function(require,module,exports) {
            var define;
            var e;!function(t,c,r){"object"==typeof exports?module.exports=exports=c(require("./core"),require("./enc-base64"),require("./md5"),require("./evpkdf"),require("./cipher-core")):"function"==typeof e&&e.amd?e(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],c):c(t.CryptoJS)}(this,function(e){return function(){var t=e,c=t.lib,r=c.WordArray,i=c.BlockCipher,o=t.algo,l=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],s=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],h=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],k=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],_=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],n=o.DES=i.extend({_doReset:function(){for(var e=this._key.words,t=[],c=0;c<56;c++){var r=l[c]-1;t[c]=e[r>>>5]>>>31-r%32&1}for(var i=this._subKeys=[],o=0;o<16;o++){var k=i[o]=[],_=h[o];for(c=0;c<24;c++)k[c/6|0]|=t[(s[c]-1+_)%28]<<31-c%6,k[4+(c/6|0)]|=t[28+(s[c+24]-1+_)%28]<<31-c%6;k[0]=k[0]<<1|k[0]>>>31;for(c=1;c<7;c++)k[c]=k[c]>>>4*(c-1)+3;k[7]=k[7]<<5|k[7]>>>27}var n=this._invSubKeys=[];for(c=0;c<16;c++)n[c]=i[15-c]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._subKeys)},decryptBlock:function(e,t){this._doCryptBlock(e,t,this._invSubKeys)},_doCryptBlock:function(e,t,c){this._lBlock=e[t],this._rBlock=e[t+1],a.call(this,4,252645135),a.call(this,16,65535),B.call(this,2,858993459),B.call(this,8,16711935),a.call(this,1,1431655765);for(var r=0;r<16;r++){for(var i=c[r],o=this._lBlock,l=this._rBlock,s=0,h=0;h<8;h++)s|=k[h][((l^i[h])&_[h])>>>0];this._lBlock=l,this._rBlock=o^s}var n=this._lBlock;this._lBlock=this._rBlock,this._rBlock=n,a.call(this,1,1431655765),B.call(this,8,16711935),B.call(this,2,858993459),a.call(this,16,65535),a.call(this,4,252645135),e[t]=this._lBlock,e[t+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function a(e,t){var c=(this._lBlock>>>e^this._rBlock)&t;this._rBlock^=c,this._lBlock^=c<<e}function B(e,t){var c=(this._rBlock>>>e^this._lBlock)&t;this._lBlock^=c,this._rBlock^=c<<e}t.DES=i._createHelper(n);var p=o.TripleDES=i.extend({_doReset:function(){var e=this._key.words;this._des1=n.createEncryptor(r.create(e.slice(0,2))),this._des2=n.createEncryptor(r.create(e.slice(2,4))),this._des3=n.createEncryptor(r.create(e.slice(4,6)))},encryptBlock:function(e,t){this._des1.encryptBlock(e,t),this._des2.decryptBlock(e,t),this._des3.encryptBlock(e,t)},decryptBlock:function(e,t){this._des3.decryptBlock(e,t),this._des2.encryptBlock(e,t),this._des1.decryptBlock(e,t)},keySize:6,ivSize:2,blockSize:2});t.TripleDES=i._createHelper(p)}(),e.TripleDES});
        },{"./core":"eUTO","./enc-base64":"/pJa","./md5":"GVDV","./evpkdf":"W9aa","./cipher-core":"uCLB"}],"6pOM":[function(require,module,exports) {
            var define;
            var e;!function(r,t,i){"object"==typeof exports?module.exports=exports=t(require("./core"),require("./enc-base64"),require("./md5"),require("./evpkdf"),require("./cipher-core")):"function"==typeof e&&e.amd?e(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],t):t(r.CryptoJS)}(this,function(e){return function(){var r=e,t=r.lib.StreamCipher,i=r.algo,o=i.RC4=t.extend({_doReset:function(){for(var e=this._key,r=e.words,t=e.sigBytes,i=this._S=[],o=0;o<256;o++)i[o]=o;o=0;for(var c=0;o<256;o++){var s=o%t,n=r[s>>>2]>>>24-s%4*8&255;c=(c+i[o]+n)%256;var a=i[o];i[o]=i[c],i[c]=a}this._i=this._j=0},_doProcessBlock:function(e,r){e[r]^=c.call(this)},keySize:8,ivSize:0});function c(){for(var e=this._S,r=this._i,t=this._j,i=0,o=0;o<4;o++){t=(t+e[r=(r+1)%256])%256;var c=e[r];e[r]=e[t],e[t]=c,i|=e[(e[r]+e[t])%256]<<24-8*o}return this._i=r,this._j=t,i}r.RC4=t._createHelper(o);var s=i.RC4Drop=o.extend({cfg:o.cfg.extend({drop:192}),_doReset:function(){o._doReset.call(this);for(var e=this.cfg.drop;e>0;e--)c.call(this)}});r.RC4Drop=t._createHelper(s)}(),e.RC4});
        },{"./core":"eUTO","./enc-base64":"/pJa","./md5":"GVDV","./evpkdf":"W9aa","./cipher-core":"uCLB"}],"f+1H":[function(require,module,exports) {
            var define;
            var r;!function(e,i,t){"object"==typeof exports?module.exports=exports=i(require("./core"),require("./enc-base64"),require("./md5"),require("./evpkdf"),require("./cipher-core")):"function"==typeof r&&r.amd?r(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],i):i(e.CryptoJS)}(this,function(r){return function(){var e=r,i=e.lib.StreamCipher,t=e.algo,o=[],c=[],s=[],a=t.Rabbit=i.extend({_doReset:function(){for(var r=this._key.words,e=this.cfg.iv,i=0;i<4;i++)r[i]=16711935&(r[i]<<8|r[i]>>>24)|4278255360&(r[i]<<24|r[i]>>>8);var t=this._X=[r[0],r[3]<<16|r[2]>>>16,r[1],r[0]<<16|r[3]>>>16,r[2],r[1]<<16|r[0]>>>16,r[3],r[2]<<16|r[1]>>>16],o=this._C=[r[2]<<16|r[2]>>>16,4294901760&r[0]|65535&r[1],r[3]<<16|r[3]>>>16,4294901760&r[1]|65535&r[2],r[0]<<16|r[0]>>>16,4294901760&r[2]|65535&r[3],r[1]<<16|r[1]>>>16,4294901760&r[3]|65535&r[0]];this._b=0;for(i=0;i<4;i++)f.call(this);for(i=0;i<8;i++)o[i]^=t[i+4&7];if(e){var c=e.words,s=c[0],a=c[1],n=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),h=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),b=n>>>16|4294901760&h,u=h<<16|65535&n;o[0]^=n,o[1]^=b,o[2]^=h,o[3]^=u,o[4]^=n,o[5]^=b,o[6]^=h,o[7]^=u;for(i=0;i<4;i++)f.call(this)}},_doProcessBlock:function(r,e){var i=this._X;f.call(this),o[0]=i[0]^i[5]>>>16^i[3]<<16,o[1]=i[2]^i[7]>>>16^i[5]<<16,o[2]=i[4]^i[1]>>>16^i[7]<<16,o[3]=i[6]^i[3]>>>16^i[1]<<16;for(var t=0;t<4;t++)o[t]=16711935&(o[t]<<8|o[t]>>>24)|4278255360&(o[t]<<24|o[t]>>>8),r[e+t]^=o[t]},blockSize:4,ivSize:2});function f(){for(var r=this._X,e=this._C,i=0;i<8;i++)c[i]=e[i];e[0]=e[0]+1295307597+this._b|0,e[1]=e[1]+3545052371+(e[0]>>>0<c[0]>>>0?1:0)|0,e[2]=e[2]+886263092+(e[1]>>>0<c[1]>>>0?1:0)|0,e[3]=e[3]+1295307597+(e[2]>>>0<c[2]>>>0?1:0)|0,e[4]=e[4]+3545052371+(e[3]>>>0<c[3]>>>0?1:0)|0,e[5]=e[5]+886263092+(e[4]>>>0<c[4]>>>0?1:0)|0,e[6]=e[6]+1295307597+(e[5]>>>0<c[5]>>>0?1:0)|0,e[7]=e[7]+3545052371+(e[6]>>>0<c[6]>>>0?1:0)|0,this._b=e[7]>>>0<c[7]>>>0?1:0;for(i=0;i<8;i++){var t=r[i]+e[i],o=65535&t,a=t>>>16,f=((o*o>>>17)+o*a>>>15)+a*a,n=((4294901760&t)*t|0)+((65535&t)*t|0);s[i]=f^n}r[0]=s[0]+(s[7]<<16|s[7]>>>16)+(s[6]<<16|s[6]>>>16)|0,r[1]=s[1]+(s[0]<<8|s[0]>>>24)+s[7]|0,r[2]=s[2]+(s[1]<<16|s[1]>>>16)+(s[0]<<16|s[0]>>>16)|0,r[3]=s[3]+(s[2]<<8|s[2]>>>24)+s[1]|0,r[4]=s[4]+(s[3]<<16|s[3]>>>16)+(s[2]<<16|s[2]>>>16)|0,r[5]=s[5]+(s[4]<<8|s[4]>>>24)+s[3]|0,r[6]=s[6]+(s[5]<<16|s[5]>>>16)+(s[4]<<16|s[4]>>>16)|0,r[7]=s[7]+(s[6]<<8|s[6]>>>24)+s[5]|0}e.Rabbit=i._createHelper(a)}(),r.Rabbit});
        },{"./core":"eUTO","./enc-base64":"/pJa","./md5":"GVDV","./evpkdf":"W9aa","./cipher-core":"uCLB"}],"vtgx":[function(require,module,exports) {
            var define;
            var e;!function(r,i,t){"object"==typeof exports?module.exports=exports=i(require("./core"),require("./enc-base64"),require("./md5"),require("./evpkdf"),require("./cipher-core")):"function"==typeof e&&e.amd?e(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],i):i(r.CryptoJS)}(this,function(e){return function(){var r=e,i=r.lib.StreamCipher,t=r.algo,o=[],c=[],a=[],s=t.RabbitLegacy=i.extend({_doReset:function(){var e=this._key.words,r=this.cfg.iv,i=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],t=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];this._b=0;for(var o=0;o<4;o++)f.call(this);for(o=0;o<8;o++)t[o]^=i[o+4&7];if(r){var c=r.words,a=c[0],s=c[1],n=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),h=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),b=n>>>16|4294901760&h,u=h<<16|65535&n;t[0]^=n,t[1]^=b,t[2]^=h,t[3]^=u,t[4]^=n,t[5]^=b,t[6]^=h,t[7]^=u;for(o=0;o<4;o++)f.call(this)}},_doProcessBlock:function(e,r){var i=this._X;f.call(this),o[0]=i[0]^i[5]>>>16^i[3]<<16,o[1]=i[2]^i[7]>>>16^i[5]<<16,o[2]=i[4]^i[1]>>>16^i[7]<<16,o[3]=i[6]^i[3]>>>16^i[1]<<16;for(var t=0;t<4;t++)o[t]=16711935&(o[t]<<8|o[t]>>>24)|4278255360&(o[t]<<24|o[t]>>>8),e[r+t]^=o[t]},blockSize:4,ivSize:2});function f(){for(var e=this._X,r=this._C,i=0;i<8;i++)c[i]=r[i];r[0]=r[0]+1295307597+this._b|0,r[1]=r[1]+3545052371+(r[0]>>>0<c[0]>>>0?1:0)|0,r[2]=r[2]+886263092+(r[1]>>>0<c[1]>>>0?1:0)|0,r[3]=r[3]+1295307597+(r[2]>>>0<c[2]>>>0?1:0)|0,r[4]=r[4]+3545052371+(r[3]>>>0<c[3]>>>0?1:0)|0,r[5]=r[5]+886263092+(r[4]>>>0<c[4]>>>0?1:0)|0,r[6]=r[6]+1295307597+(r[5]>>>0<c[5]>>>0?1:0)|0,r[7]=r[7]+3545052371+(r[6]>>>0<c[6]>>>0?1:0)|0,this._b=r[7]>>>0<c[7]>>>0?1:0;for(i=0;i<8;i++){var t=e[i]+r[i],o=65535&t,s=t>>>16,f=((o*o>>>17)+o*s>>>15)+s*s,n=((4294901760&t)*t|0)+((65535&t)*t|0);a[i]=f^n}e[0]=a[0]+(a[7]<<16|a[7]>>>16)+(a[6]<<16|a[6]>>>16)|0,e[1]=a[1]+(a[0]<<8|a[0]>>>24)+a[7]|0,e[2]=a[2]+(a[1]<<16|a[1]>>>16)+(a[0]<<16|a[0]>>>16)|0,e[3]=a[3]+(a[2]<<8|a[2]>>>24)+a[1]|0,e[4]=a[4]+(a[3]<<16|a[3]>>>16)+(a[2]<<16|a[2]>>>16)|0,e[5]=a[5]+(a[4]<<8|a[4]>>>24)+a[3]|0,e[6]=a[6]+(a[5]<<16|a[5]>>>16)+(a[4]<<16|a[4]>>>16)|0,e[7]=a[7]+(a[6]<<8|a[6]>>>24)+a[5]|0}r.RabbitLegacy=i._createHelper(s)}(),e.RabbitLegacy});
        },{"./core":"eUTO","./enc-base64":"/pJa","./md5":"GVDV","./evpkdf":"W9aa","./cipher-core":"uCLB"}],"M4F+":[function(require,module,exports) {
            var define;
            var e;!function(r,i,a){"object"==typeof exports?module.exports=exports=i(require("./core"),require("./x64-core"),require("./lib-typedarrays"),require("./enc-utf16"),require("./enc-base64"),require("./md5"),require("./sha1"),require("./sha256"),require("./sha224"),require("./sha512"),require("./sha384"),require("./sha3"),require("./ripemd160"),require("./hmac"),require("./pbkdf2"),require("./evpkdf"),require("./cipher-core"),require("./mode-cfb"),require("./mode-ctr"),require("./mode-ctr-gladman"),require("./mode-ofb"),require("./mode-ecb"),require("./pad-ansix923"),require("./pad-iso10126"),require("./pad-iso97971"),require("./pad-zeropadding"),require("./pad-nopadding"),require("./format-hex"),require("./aes"),require("./tripledes"),require("./rc4"),require("./rabbit"),require("./rabbit-legacy")):"function"==typeof e&&e.amd?e(["./core","./x64-core","./lib-typedarrays","./enc-utf16","./enc-base64","./md5","./sha1","./sha256","./sha224","./sha512","./sha384","./sha3","./ripemd160","./hmac","./pbkdf2","./evpkdf","./cipher-core","./mode-cfb","./mode-ctr","./mode-ctr-gladman","./mode-ofb","./mode-ecb","./pad-ansix923","./pad-iso10126","./pad-iso97971","./pad-zeropadding","./pad-nopadding","./format-hex","./aes","./tripledes","./rc4","./rabbit","./rabbit-legacy"],i):r.CryptoJS=i(r.CryptoJS)}(this,function(e){return e});
        },{"./core":"eUTO","./x64-core":"M95N","./lib-typedarrays":"X5QY","./enc-utf16":"0xZK","./enc-base64":"/pJa","./md5":"GVDV","./sha1":"yxyM","./sha256":"MS2N","./sha224":"OEnX","./sha512":"xA62","./sha384":"YkB8","./sha3":"F6e3","./ripemd160":"Y8c+","./hmac":"IKo8","./pbkdf2":"/NfQ","./evpkdf":"W9aa","./cipher-core":"uCLB","./mode-cfb":"dnNm","./mode-ctr":"iAFA","./mode-ctr-gladman":"Oy1Y","./mode-ofb":"/HXd","./mode-ecb":"QDS2","./pad-ansix923":"1Hi7","./pad-iso10126":"HttL","./pad-iso97971":"letQ","./pad-zeropadding":"aieV","./pad-nopadding":"GO8Y","./format-hex":"vtW7","./aes":"Srb3","./tripledes":"ySCI","./rc4":"6pOM","./rabbit":"f+1H","./rabbit-legacy":"vtgx"}],"KTph":[function(require,module,exports) {
            "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=i(require("crypto-js")),t=i(require("./utils"));function i(e){return e&&e.__esModule?e:{default:e}}var o=function e(t,i){return!this instanceof e?new e(t):(this._msg={},"function"==typeof e[t]&&(e[t].prototype.setGroup=this.setGroup,this._msg=new e[t](i)),this._msg)};o.prototype.setGroup=function(e){this.body.group=e},o.read=function(e){this.id=e,this.type="read"},o.read.prototype.set=function(e){this.body={id:this.id,type:this.type,ackId:e.id,to:e.to}},o.delivery=function(e){this.id=e,this.type="delivery"},o.delivery.prototype.set=function(e){this.body={id:this.id,type:this.type,bodyId:e.bodyId,to:e.to}},o.txt=function(e){this.id=e,this.type="txt",this.body={}},o.txt.prototype.set=function(e){this.value=e.msg,this.body={id:this.id,to:e.to,msg:this.value,type:this.type,roomType:e.roomType,ext:e.ext||{},success:e.success,fail:e.fail},!e.roomType&&delete this.body.roomType},o.cmd=function(e){this.id=e,this.type="cmd",this.body={}},o.cmd.prototype.set=function(e){this.value="",this.body={id:this.id,to:e.to,action:e.action,msg:this.value,type:this.type,roomType:e.roomType,ext:e.ext||{},success:e.success},!e.roomType&&delete this.body.roomType},o.location=function(e){this.id=e,this.type="loc",this.body={}},o.location.prototype.set=function(e){this.body={id:this.id,to:e.to,type:this.type,roomType:e.roomType,addr:e.addr,lat:e.lat,lng:e.lng,ext:e.ext||{}}},o.img=function(e){this.id=e,this.type="img",this.body={}},o.img.prototype.set=function(e){e.file=e.file||t.default.getFileUrl(e.fileInputId),this.value=e.file,this.body={id:this.id,file:this.value,apiUrl:e.apiUrl,to:e.to,type:this.type,ext:e.ext||{},roomType:e.roomType,onFileUploadError:e.onFileUploadError,onFileUploadComplete:e.onFileUploadComplete,success:e.success,fail:e.fail,flashUpload:e.flashUpload,width:e.width,height:e.height,body:e.body,uploadError:e.uploadError,uploadComplete:e.uploadComplete},!e.roomType&&delete this.body.roomType},o.audio=function(e){this.id=e,this.type="audio",this.body={}},o.audio.prototype.set=function(e){e.file=e.file||t.default.getFileUrl(e.fileInputId),this.value=e.file,this.filename=e.filename||this.value.filename,this.body={id:this.id,file:this.value,filename:this.filename,apiUrl:e.apiUrl,to:e.to,type:this.type,ext:e.ext||{},length:e.length||0,roomType:e.roomType,file_length:e.file_length,onFileUploadError:e.onFileUploadError,onFileUploadComplete:e.onFileUploadComplete,success:e.success,fail:e.fail,flashUpload:e.flashUpload,body:e.body},!e.roomType&&delete this.body.roomType},o.file=function(e){this.id=e,this.type="file",this.body={}},o.file.prototype.set=function(e){e.file=e.file||t.default.getFileUrl(e.fileInputId),this.value=e.file,this.filename=e.filename||this.value.filename,this.body={id:this.id,file:this.value,filename:this.filename,apiUrl:e.apiUrl,to:e.to,type:this.type,ext:e.ext||{},roomType:e.roomType,onFileUploadError:e.onFileUploadError,onFileUploadComplete:e.onFileUploadComplete,success:e.success,fail:e.fail,flashUpload:e.flashUpload,body:e.body},!e.roomType&&delete this.body.roomType},o.video=function(e){this.id=e,this.type="video",this.body={}},o.video.prototype.set=function(e){e.file=e.file||t.default.getFileUrl(e.fileInputId),this.value=e.file,this.filename=e.filename||this.value.filename,this.body={id:this.id,file:this.value,filename:this.filename,apiUrl:e.apiUrl,to:e.to,type:this.type,ext:e.ext||{},length:e.length||0,roomType:e.roomType,file_length:e.file_length,onFileUploadError:e.onFileUploadError,onFileUploadComplete:e.onFileUploadComplete,success:e.success,fail:e.fail,flashUpload:e.flashUpload,body:e.body},!e.roomType&&delete this.body.roomType};var s=function e(t){if(!this instanceof e)return new e(t,conn);this.msg=t};s.prototype.send=function(e){var i=this,o=function(i){var o;i.ext=i.ext||{},i.ext.weichat=i.ext.weichat||{},i.ext.weichat.originType=i.ext.weichat.originType||"webim";var s={from:e.context.userId||"",to:i.to,bodies:[i.body],ext:i.ext||{}},l=t.default.stringify(s);if(o=$msg({type:i.group||"chat",to:i.toJid,id:i.id,xmlns:"jabber:client"}).c("body").t(l),i.roomType&&o.up().c("roomtype",{xmlns:"easemob:x:roomtype",type:"chatroom"}),i.bodyId){o=$msg({from:e.context.jid||"",to:i.toJid,id:i.id,xmlns:"jabber:client"}).c("body").t(i.bodyId);var d={xmlns:"urn:xmpp:receipts",id:i.bodyId};o.up().c("delivery",d)}if(i.ackId){if(e.context.jid.indexOf(i.toJid)>=0)return;o=$msg({from:e.context.jid||"",to:i.toJid,id:i.id,xmlns:"jabber:client"}).c("body").t(i.ackId);var n={xmlns:"urn:xmpp:receipts",id:i.ackId};o.up().c("acked",n)}setTimeout(function(){"undefined"!=typeof _msgHash&&_msgHash[i.id]&&_msgHash[i.id].msg.fail instanceof Function&&_msgHash[i.id].msg.fail(i.id)},6e4),e.sendCommand(o.tree(),i.id)};if(i.msg.file){if(i.msg.body&&i.msg.body.url)return void o(i.msg);var s=i.msg.onFileUploadComplete;i.msg.onFileUploadComplete=function(t){if(t.entities[0]["file-metadata"]){var l=t.entities[0]["file-metadata"]["content-length"];i.msg.filetype=t.entities[0]["file-metadata"]["content-type"],l>204800&&(i.msg.thumbnail=!0)}i.msg.body={type:i.msg.type||"file",url:("https:"!=location.protocol&&e.isHttpDNS?e.apiUrl+t.uri.substr(t.uri.indexOf("/",9)):t.uri)+"/"+t.entities[0].uuid,secret:t.entities[0]["share-secret"],filename:i.msg.file.filename||i.msg.filename,size:{width:i.msg.width||0,height:i.msg.height||0},length:i.msg.length||0,file_length:i.msg.ext.file_length||0,filetype:i.msg.filetype},o(i.msg),s instanceof Function&&s(t,i.msg.id)},t.default.uploadFile.call(e,i.msg)}else i.msg.body={type:"chat"===i.msg.type?"txt":i.msg.type,msg:i.msg.msg},"cmd"===i.msg.type?i.msg.body.action=i.msg.action:"loc"===i.msg.type&&(i.msg.body.addr=i.msg.addr,i.msg.body.lat=i.msg.lat,i.msg.body.lng=i.msg.lng),o(i.msg)};var l={_msg:s,message:o},d=l;exports.default=d;
        },{"crypto-js":"M4F+","./utils":"K0yk"}],"RCHR":[function(require,module,exports) {
            "use strict";function t(t){this.array=void 0===t?[]:new Array(t)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0,t.prototype={length:function(){return this.array.length},at:function(t){return this.array[t]},set:function(t,r){this.array[t]=r},push:function(t){return this.array.push(t)},slice:function(t,r){return this.array=this.array.slice(t,r)},concat:function(t){this.array=this.array.concat(t)},remove:function(t,r){r=void 0===r?1:r,this.array.splice(t,r)},join:function(t){return this.array.join(t)},clear:function(){this.array.length=0}};var r=function(){this._array_h=new t};r.prototype={_index:0,push:function(t){this._array_h.push(t)},pop:function(){var t=null;return this._array_h.length()&&(t=this._array_h.at(this._index),2*++this._index>=this._array_h.length()&&(this._array_h.slice(this._index),this._index=0)),t},head:function(){var t=null,r=this._array_h.length();return r&&(t=this._array_h.at(r-1)),t},tail:function(){var t=null;return this._array_h.length()&&(t=this._array_h.at(this._index)),t},length:function(){return this._array_h.length()-this._index},empty:function(){return 0===this._array_h.length()},clear:function(){this._array_h.clear()}};var n=r;exports.default=n;
        },{}],"Aofe":[function(require,module,exports) {
            "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=o(require("../utils"));function o(e){return e&&e.__esModule?e:{default:e}}var t=function(e,o){var t=[],a=o.context.root.lookup("easemob.pb.MessageBody.Content").decode(t);switch(e.type){case"txt":a.type=0,a.text=e.msg;break;case"img":a.type=1,a.displayName=e.body.filename,a.remotePath=e.body.url,a.secretKey=e.body.secret,a.fileLength=e.body.file_length,a.size=e.body.size,a.thumbnailDisplayName=e.body.filename;break;case"video":a.type=2,a.displayName=e.body.filename,a.remotePath=e.body.url,a.secretKey=e.body.secret,a.fileLength=e.body.file_length,a.duration=e.body.length,a.thumbnailDisplayName=e.body.filename;break;case"loc":a.type=3,a.latitude=e.lat,a.longitude=e.lng,a.address=e.addr,a.latitude=e.lat;break;case"audio":a.type=4,a.displayName=e.body.filename,a.remotePath=e.body.url,a.secretKey=e.body.secret,a.fileLength=e.body.file_length,a.duration=e.body.length,a.size=e.body.size,a.thumbnailDisplayName=e.body.filename;break;case"file":a.type=5,a.displayName=e.body.filename,a.remotePath=e.body.url,a.secretKey=e.body.secret,a.fileLength=e.body.file_length,a.size=e.body.size,a.thumbnailDisplayName=e.body.filename;break;case"cmd":a.type=6,a.action=e.action}var n=o.context.root.lookup("easemob.pb.KeyValue"),i=[];if(e.ext)for(var m in e.ext){var r=n.decode(t);r.key=m,r.type=7,r.stringValue=e.ext[m],i.push(r)}var p=o.context.root.lookup("easemob.pb.MessageBody"),d=p.decode(t);"recall"===e.type?(d.type=6,d.from={name:o.context.jid.name},d.to={name:e.to},d.ackMessageId=e.ackId):"delivery"===e.type?(d.type=5,d.from={name:o.context.jid.name},d.to={name:e.to},d.ackMessageId=e.ackId):"read"===e.type?(d.type=4,d.from={name:o.context.jid.name},d.to={name:e.to},d.ackMessageId=e.ackId):e.group||e.roomType?"groupchat"!==e.group||e.roomType?"groupchat"===e.group&&e.roomType&&(d.type=3,d.from={name:o.context.jid.name},d.to={name:e.to}):(d.type=2,d.from={name:o.context.jid.name},d.to={name:e.to}):(d.type=1,d.from={name:o.context.jid.name},d.to={name:e.to}),d.contents=[a],d.ext=i,d=p.encode(d).finish();var s=o.context.root.lookup("easemob.pb.Meta").decode(t);if(s.id=e.id,"recall"===e.type){s.from=o.context.jid;var l="easemob.com";"groupchat"!==e.group&&"chatroom"!==e.group||(l="conference.easemob.com"),s.to={appKey:o.appKey,name:e.to,domain:l}}else"delivery"===e.type?(s.from=o.context.jid,s.to={appKey:o.appKey,name:e.to,domain:"easemob.com"}):"read"===e.type?(s.from=o.context.jid,s.to={appKey:o.appKey,name:e.to,domain:"easemob.com"}):e.group||e.roomType?"groupchat"!==e.group||e.roomType?"groupchat"===e.group&&e.roomType&&(s.from={appKey:o.appKey,name:o.user,domain:"conference.easemob.com"},s.to={appKey:o.appKey,name:e.to,domain:"conference.easemob.com"}):(s.from={appKey:o.appKey,name:o.user,domain:"conference.easemob.com"},s.to={appKey:o.appKey,name:e.to,domain:"conference.easemob.com"}):(s.from=o.context.jid,s.to={appKey:o.appKey,name:e.to,domain:"easemob.com"});s.ns=1,s.payload=d;var y=o.context.root.lookup("easemob.pb.CommSyncUL"),c=y.decode(t);c.meta=s,c=y.encode(c).finish();var f=o.context.root.lookup("easemob.pb.MSync"),u=f.decode(t);u.version=o.version,u.encryptType=o.encryptType,u.command=0,u.guid=o.context.jid,u.payload=c,u=f.encode(u).finish(),o.sendMSync(u)},a=function(o,a){var n=a||this;if(n.msg=o,o.file){if(n.msg.body&&n.msg.body.url)return void t(n.msg,a);var i=n.msg.onFileUploadComplete;n.msg.onFileUploadComplete=function(e){if(e.entities[0]["file-metadata"]){var o=e.entities[0]["file-metadata"]["content-length"];n.msg.filetype=e.entities[0]["file-metadata"]["content-type"],o>204800&&(n.msg.thumbnail=!0)}n.msg.body={type:n.msg.type||"file",url:("https:"!=location.protocol&&a.isHttpDNS?a.apiUrl+e.uri.substr(e.uri.indexOf("/",9)):e.uri)+"/"+e.entities[0].uuid,secret:e.entities[0]["share-secret"],filename:n.msg.file.filename||n.msg.filename,size:{width:n.msg.width||0,height:n.msg.height||0},length:n.msg.length||0,file_length:n.msg.ext.file_length||0,filetype:n.msg.filetype||n.msg.file.filetype},t(n.msg,a),i instanceof Function&&i(e,n.msg.id)},e.default.uploadFile.call(a,n.msg)}else t(n.msg,a)},n=a;exports.default=n;
        },{"../utils":"K0yk"}],"YA3p":[function(require,module,exports) {
            module.exports=t;var i=null;try{i=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(L){}function t(i,t,n){this.low=0|i,this.high=0|t,this.unsigned=!!n}function n(i){return!0===(i&&i.__isLong__)}t.prototype.__isLong__,Object.defineProperty(t.prototype,"__isLong__",{value:!0}),t.isLong=n;var h={},s={};function e(i,t){var n,e,r;return t?(r=0<=(i>>>=0)&&i<256)&&(e=s[i])?e:(n=u(i,(0|i)<0?-1:0,!0),r&&(s[i]=n),n):(r=-128<=(i|=0)&&i<128)&&(e=h[i])?e:(n=u(i,i<0?-1:0,!1),r&&(h[i]=n),n)}function r(i,t){if(isNaN(i))return t?N:m;if(t){if(i<0)return N;if(i>=c)return p}else{if(i<=-w)return _;if(i+1>=w)return q}return i<0?r(-i,t).neg():u(i%d|0,i/d|0,t)}function u(i,n,h){return new t(i,n,h)}t.fromInt=e,t.fromNumber=r,t.fromBits=u;var o=Math.pow;function g(i,t,n){if(0===i.length)throw Error("empty string");if("NaN"===i||"Infinity"===i||"+Infinity"===i||"-Infinity"===i)return m;if("number"==typeof t?(n=t,t=!1):t=!!t,(n=n||10)<2||36<n)throw RangeError("radix");var h;if((h=i.indexOf("-"))>0)throw Error("interior hyphen");if(0===h)return g(i.substring(1),t,n).neg();for(var s=r(o(n,8)),e=m,u=0;u<i.length;u+=8){var f=Math.min(8,i.length-u),l=parseInt(i.substring(u,u+f),n);if(f<8){var a=r(o(n,f));e=e.mul(a).add(r(l))}else e=(e=e.mul(s)).add(r(l))}return e.unsigned=t,e}function f(i,t){return"number"==typeof i?r(i,t):"string"==typeof i?g(i,t):u(i.low,i.high,"boolean"==typeof t?t:i.unsigned)}t.fromString=g,t.fromValue=f;var l=65536,a=1<<24,d=l*l,c=d*d,w=c/2,v=e(a),m=e(0);t.ZERO=m;var N=e(0,!0);t.UZERO=N;var E=e(1);t.ONE=E;var y=e(1,!0);t.UONE=y;var b=e(-1);t.NEG_ONE=b;var q=u(-1,2147483647,!1);t.MAX_VALUE=q;var p=u(-1,-1,!0);t.MAX_UNSIGNED_VALUE=p;var _=u(0,-2147483648,!1);t.MIN_VALUE=_;var B=t.prototype;B.toInt=function(){return this.unsigned?this.low>>>0:this.low},B.toNumber=function(){return this.unsigned?(this.high>>>0)*d+(this.low>>>0):this.high*d+(this.low>>>0)},B.toString=function(i){if((i=i||10)<2||36<i)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(_)){var t=r(i),n=this.div(t),h=n.mul(t).sub(this);return n.toString(i)+h.toInt().toString(i)}return"-"+this.neg().toString(i)}for(var s=r(o(i,6),this.unsigned),e=this,u="";;){var g=e.div(s),f=(e.sub(g.mul(s)).toInt()>>>0).toString(i);if((e=g).isZero())return f+u;for(;f.length<6;)f="0"+f;u=""+f+u}},B.getHighBits=function(){return this.high},B.getHighBitsUnsigned=function(){return this.high>>>0},B.getLowBits=function(){return this.low},B.getLowBitsUnsigned=function(){return this.low>>>0},B.getNumBitsAbs=function(){if(this.isNegative())return this.eq(_)?64:this.neg().getNumBitsAbs();for(var i=0!=this.high?this.high:this.low,t=31;t>0&&0==(i&1<<t);t--);return 0!=this.high?t+33:t+1},B.isZero=function(){return 0===this.high&&0===this.low},B.eqz=B.isZero,B.isNegative=function(){return!this.unsigned&&this.high<0},B.isPositive=function(){return this.unsigned||this.high>=0},B.isOdd=function(){return 1==(1&this.low)},B.isEven=function(){return 0==(1&this.low)},B.equals=function(i){return n(i)||(i=f(i)),(this.unsigned===i.unsigned||this.high>>>31!=1||i.high>>>31!=1)&&(this.high===i.high&&this.low===i.low)},B.eq=B.equals,B.notEquals=function(i){return!this.eq(i)},B.neq=B.notEquals,B.ne=B.notEquals,B.lessThan=function(i){return this.comp(i)<0},B.lt=B.lessThan,B.lessThanOrEqual=function(i){return this.comp(i)<=0},B.lte=B.lessThanOrEqual,B.le=B.lessThanOrEqual,B.greaterThan=function(i){return this.comp(i)>0},B.gt=B.greaterThan,B.greaterThanOrEqual=function(i){return this.comp(i)>=0},B.gte=B.greaterThanOrEqual,B.ge=B.greaterThanOrEqual,B.compare=function(i){if(n(i)||(i=f(i)),this.eq(i))return 0;var t=this.isNegative(),h=i.isNegative();return t&&!h?-1:!t&&h?1:this.unsigned?i.high>>>0>this.high>>>0||i.high===this.high&&i.low>>>0>this.low>>>0?-1:1:this.sub(i).isNegative()?-1:1},B.comp=B.compare,B.negate=function(){return!this.unsigned&&this.eq(_)?_:this.not().add(E)},B.neg=B.negate,B.add=function(i){n(i)||(i=f(i));var t=this.high>>>16,h=65535&this.high,s=this.low>>>16,e=65535&this.low,r=i.high>>>16,o=65535&i.high,g=i.low>>>16,l=0,a=0,d=0,c=0;return d+=(c+=e+(65535&i.low))>>>16,a+=(d+=s+g)>>>16,l+=(a+=h+o)>>>16,l+=t+r,u((d&=65535)<<16|(c&=65535),(l&=65535)<<16|(a&=65535),this.unsigned)},B.subtract=function(i){return n(i)||(i=f(i)),this.add(i.neg())},B.sub=B.subtract,B.multiply=function(t){if(this.isZero())return m;if(n(t)||(t=f(t)),i)return u(i.mul(this.low,this.high,t.low,t.high),i.get_high(),this.unsigned);if(t.isZero())return m;if(this.eq(_))return t.isOdd()?_:m;if(t.eq(_))return this.isOdd()?_:m;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(v)&&t.lt(v))return r(this.toNumber()*t.toNumber(),this.unsigned);var h=this.high>>>16,s=65535&this.high,e=this.low>>>16,o=65535&this.low,g=t.high>>>16,l=65535&t.high,a=t.low>>>16,d=65535&t.low,c=0,w=0,N=0,E=0;return N+=(E+=o*d)>>>16,w+=(N+=e*d)>>>16,N&=65535,w+=(N+=o*a)>>>16,c+=(w+=s*d)>>>16,w&=65535,c+=(w+=e*a)>>>16,w&=65535,c+=(w+=o*l)>>>16,c+=h*d+s*a+e*l+o*g,u((N&=65535)<<16|(E&=65535),(c&=65535)<<16|(w&=65535),this.unsigned)},B.mul=B.multiply,B.divide=function(t){if(n(t)||(t=f(t)),t.isZero())throw Error("division by zero");var h,s,e;if(i)return this.unsigned||-2147483648!==this.high||-1!==t.low||-1!==t.high?u((this.unsigned?i.div_u:i.div_s)(this.low,this.high,t.low,t.high),i.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?N:m;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return N;if(t.gt(this.shru(1)))return y;e=N}else{if(this.eq(_))return t.eq(E)||t.eq(b)?_:t.eq(_)?E:(h=this.shr(1).div(t).shl(1)).eq(m)?t.isNegative()?E:b:(s=this.sub(t.mul(h)),e=h.add(s.div(t)));if(t.eq(_))return this.unsigned?N:m;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();e=m}for(s=this;s.gte(t);){h=Math.max(1,Math.floor(s.toNumber()/t.toNumber()));for(var g=Math.ceil(Math.log(h)/Math.LN2),l=g<=48?1:o(2,g-48),a=r(h),d=a.mul(t);d.isNegative()||d.gt(s);)d=(a=r(h-=l,this.unsigned)).mul(t);a.isZero()&&(a=E),e=e.add(a),s=s.sub(d)}return e},B.div=B.divide,B.modulo=function(t){return n(t)||(t=f(t)),i?u((this.unsigned?i.rem_u:i.rem_s)(this.low,this.high,t.low,t.high),i.get_high(),this.unsigned):this.sub(this.div(t).mul(t))},B.mod=B.modulo,B.rem=B.modulo,B.not=function(){return u(~this.low,~this.high,this.unsigned)},B.and=function(i){return n(i)||(i=f(i)),u(this.low&i.low,this.high&i.high,this.unsigned)},B.or=function(i){return n(i)||(i=f(i)),u(this.low|i.low,this.high|i.high,this.unsigned)},B.xor=function(i){return n(i)||(i=f(i)),u(this.low^i.low,this.high^i.high,this.unsigned)},B.shiftLeft=function(i){return n(i)&&(i=i.toInt()),0==(i&=63)?this:i<32?u(this.low<<i,this.high<<i|this.low>>>32-i,this.unsigned):u(0,this.low<<i-32,this.unsigned)},B.shl=B.shiftLeft,B.shiftRight=function(i){return n(i)&&(i=i.toInt()),0==(i&=63)?this:i<32?u(this.low>>>i|this.high<<32-i,this.high>>i,this.unsigned):u(this.high>>i-32,this.high>=0?0:-1,this.unsigned)},B.shr=B.shiftRight,B.shiftRightUnsigned=function(i){if(n(i)&&(i=i.toInt()),0===(i&=63))return this;var t=this.high;return i<32?u(this.low>>>i|t<<32-i,t>>>i,this.unsigned):u(32===i?t:t>>>i-32,0,this.unsigned)},B.shru=B.shiftRightUnsigned,B.shr_u=B.shiftRightUnsigned,B.toSigned=function(){return this.unsigned?u(this.low,this.high,!1):this},B.toUnsigned=function(){return this.unsigned?this:u(this.low,this.high,!0)},B.toBytes=function(i){return i?this.toBytesLE():this.toBytesBE()},B.toBytesLE=function(){var i=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24,255&i,i>>>8&255,i>>>16&255,i>>>24]},B.toBytesBE=function(){var i=this.high,t=this.low;return[i>>>24,i>>>16&255,i>>>8&255,255&i,t>>>24,t>>>16&255,t>>>8&255,255&t]},t.fromBytes=function(i,n,h){return h?t.fromBytesLE(i,n):t.fromBytesBE(i,n)},t.fromBytesLE=function(i,n){return new t(i[0]|i[1]<<8|i[2]<<16|i[3]<<24,i[4]|i[5]<<8|i[6]<<16|i[7]<<24,n)},t.fromBytesBE=function(i,n){return new t(i[4]<<24|i[5]<<16|i[6]<<8|i[7],i[0]<<24|i[1]<<16|i[2]<<8|i[3],n)};
        },{}],"TvlR":[function(require,module,exports) {
            "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=a(require("long")),t=a(require("../utils")),r=a(require("./sendChatMessage")),o=a(require("../status"));function a(e){return e&&e.__esModule?e:{default:e}}var s=(0,o.default)(),d=function(e,t,o){if(e.delivery){var a=e.getUniqueId(),s=new WebIM.message("delivery",a);s.set({ackId:o,to:t.from}),(0,r.default)(s.body,e)}},i=function(r,o,a,i){var l=a,n=l.context.root.lookup("easemob.pb.MessageBody").decode(r.payload),c=new e.default(r.id.low,r.id.high,r.id.unsigned).toString(),f=n.ackMessageId?new e.default(n.ackMessageId.low,n.ackMessageId.high,n.ackMessageId.unsigned).toString():"",u=null;if(1===n.type)u="chat";else if(2===n.type)u="groupchat";else if(3===n.type)u="chatroom";else{if(4===n.type)return u="read_ack",void a.onReadMessage({mid:f});if(5===n.type)return u="deliver_ack",void a.onDeliverdMessage({mid:f});if(6===n.type)return u="recall",void a.onRecallMessage({mid:f})}for(var y=0;y<n.contents.length;y++){for(var m={},g=o.errorCode>0,h=o.errorCode,p=o.reason,x=n.contents[y],M=n.from.name,k=n.to.name,b={},v=0;v<n.ext.length;v++)b[n.ext[v].key]=n.ext[v].stringValue;try{switch(x.type){case 0:var C=n.contents[y].text,_=t.default.parseTextMessage(C,WebIM.Emoji);_.isemoji?(!(m={id:c,type:u,from:M,to:k,data:_.body,ext:b}).delay&&delete m.delay,m.error=g,m.errorText=p,m.errorCode=h,!i&&l.onEmojiMessage(m)):((m={id:c,type:u,from:M,to:k,data:x.text,ext:b,sourceMsg:x.text}).error=g,m.errorText=p,m.errorCode=h,!i&&a.onTextMessage(m));break;case 1:if(x.size)var P=x.size.width||0,T=x.size.height||0;!(m={id:c,type:u,from:M,to:k,url:x.remotePath&&l.apiUrl+x.remotePath.substr(x.remotePath.indexOf("/",9)),secret:x.secretKey,filename:x.displayName,thumb:x.thumbnailRemotePath,thumb_secret:x.thumbnailSecretKey,file_length:x.fileLength||"",width:P,height:T,filetype:x.filetype||"",accessToken:a.token||"",ext:b}).delay&&delete m.delay,m.error=g,m.errorText=p,m.errorCode=h,!i&&a.onPictureMessage(m);break;case 2:!(m={id:c,type:u,from:M,to:k,url:x.remotePath&&l.apiUrl+x.remotePath.substr(x.remotePath.indexOf("/",9)),secret:x.secretKey,filename:x.displayName,length:x.duration||"",file_length:x.fileLength||"",filetype:x.filetype||"",accessToken:a.token||"",ext:b}).delay&&delete m.delay,m.error=g,m.errorText=p,m.errorCode=h,!i&&a.onVideoMessage(m);break;case 3:!(m={id:c,type:u,from:M,to:k,addr:x.address,lat:x.latitude,lng:x.longitude,ext:b}).delay&&delete m.delay,m.error=g,m.errorText=p,m.errorCode=h,!i&&a.onLocationMessage(m);break;case 4:!(m={id:c,type:u,from:M,to:k,url:x.remotePath&&l.apiUrl+x.remotePath.substr(x.remotePath.indexOf("/",9)),secret:x.secretKey,filename:x.displayName,file_length:x.fileLength||"",accessToken:a.token||"",ext:b,length:x.duration}).delay&&delete m.delay,m.error=g,m.errorText=p,m.errorCode=h,!i&&a.onAudioMessage(m);break;case 5:!(m={id:c,type:u,from:M,to:k,url:x.remotePath&&l.apiUrl+x.remotePath.substr(x.remotePath.indexOf("/",9)),secret:x.secretKey,filename:x.displayName,file_length:x.fileLength,accessToken:a.token||"",ext:b}).delay&&delete m.delay,m.error=g,m.errorText=p,m.errorCode=h,!i&&a.onFileMessage(m);break;case 6:(m={id:c,from:M,to:k,action:x.action,ext:b}).error=g,m.errorText=p,m.errorCode=h,!i&&a.onCmdMessage(m)}}catch(I){a.onError({type:s.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,data:I})}if(!i&&d(a,m,c),i)return m.message_type=u,m}},l=i;exports.default=l;
        },{"long":"YA3p","../utils":"K0yk","./sendChatMessage":"Aofe","../status":"KLYY"}],"wnFo":[function(require,module,exports) {
            "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=n(require("long"));function n(e){return e&&e.__esModule?e:{default:e}}var o=function(n,o,t){var c=t.context.root.lookup("easemob.pb.MUCBody").decode(n.payload);new e.default(n.id.low,n.id.high,n.id.unsigned).toString();!function(e){var n={type:"",owner:c.from.name,gid:c.mucId.name,from:c.from.name,fromJid:c.from,to:c.to.length?c.to[0].name:"",toJid:c.to,chatroom:c.isChatroom,status:c.status};({28:function(){n.type="deleteFile",t.onPresence(n)},27:function(){n.type="uploadFile",t.onPresence(n)},26:function(){n.type="deleteAnnouncement",t.onPresence(n)},25:function(){n.type="updateAnnouncement",t.onPresence(n)},24:function(){n.type="removeMute",t.onPresence(n)},23:function(){n.type="addMute",t.onPresence(n)},22:function(){n.type="removeAdmin",t.onPresence(n)},21:function(){n.type="addAdmin",t.onPresence(n)},20:function(){n.type="changeOwner",t.onPresence(n)},19:function(){n.type="direct_joined",t.onPresence(n)},18:function(){n.type=c.isChatroom?"leaveChatRoom":"leaveGroup",t.onPresence(n)},17:function(){n.type=c.isChatroom?"memberJoinChatRoomSuccess":"memberJoinPublicGroupSuccess",t.onPresence(n)},16:function(){n.type="unblock",t.onPresence(n)},15:function(){n.type="block",t.onPresence(n)},14:function(){n.type="update",t.onPresence(n)},13:function(){n.type="allow",n.reason=c.reason,t.onPresence(n)},12:function(){n.type="ban",t.onPresence(n)},11:function(){n.type="getBlackList",t.onPresence(n)},10:function(){n.type="removedFromGroup",n.kicked=n.to,t.onPresence(n)},9:function(){n.type="invite_decline",n.kicked=n.to,t.onPresence(n)},8:function(){n.type="invite_accept",n.kicked=n.to,t.onPresence(n)},7:function(){n.type="invite",n.kicked=n.to,t.onPresence(n)},6:function(){n.type="joinPublicGroupDeclined",t.onPresence(n)},5:function(){n.type="joinPublicGroupSuccess",t.onPresence(n)},4:function(){n.type="joinGroupNotifications",n.reason=c.reason,t.onPresence(n)},3:function(){n.type="leave",t.onPresence(n)},2:function(){n.type="join",t.onPresence(n)},1:function(){n.type="deleteGroupChat",t.onPresence(n)}}[e]||function(){console.log("%c没有匹配".concat(e,"类型"),"background: green")})()}(c.operation)},t=o;exports.default=t;
        },{"long":"YA3p"}],"UOYe":[function(require,module,exports) {
            "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=o(require("long"));function o(e){return e&&e.__esModule?e:{default:e}}var a=function(e,o,a){var t=[],n=a.context.root.lookup("easemob.pb.RosterBody"),r=n.decode(t);"add"===o?r.operation=2:"remove"===o?r.operation=3:"accept"===o?r.operation=4:"decline"===o?r.operation=5:"ban"===o?r.operation=6:"allow"===o&&(r.operation=7),r.from=a.context.jid,r.to=[{appKey:a.appKey,name:e.to,domain:"easemob.com"}],r.reason=e.message,r=n.encode(r).finish();var s=a.context.root.lookup("easemob.pb.Meta").decode(t);s.id=e.id||a.getUniqueId(),s.from=a.context.jid,s.to={domain:"@easemob.com"},s.ns=3,s.payload=r;var d=a.context.root.lookup("easemob.pb.CommSyncUL"),c=d.decode(t);c.meta=s,c=d.encode(c).finish();var i=a.context.root.lookup("easemob.pb.MSync"),p=i.decode(t);p.version=a.version,p.encryptType=[0],p.command=0,p.guid=a.jid,p.payload=c,p=i.encode(p).finish(),a.sendMSync(p)},t=function(o,a,t){var n=t.context.root.lookup("easemob.pb.RosterBody").decode(o.payload),r=(new e.default(o.id.low,o.id.high,o.id.unsigned).toString(),{to:n.to[0].name,from:n.from.name,status:n.reason});switch(n.operation){case 0:break;case 2:r.type="subscribe";break;case 3:r.type="unsubscribed";break;case 4:r.type="subscribed";break;case 5:r.type="unsubscribed";break;case 6:case 7:t.getBlacklist();break;case 8:r.type="subscribed";break;case 9:r.type="unsubscribed"}t.onPresence(r)},n={handleMessage:t,operatRoster:a},r=n;exports.default=r;
        },{"long":"YA3p"}],"pE/p":[function(require,module,exports) {
            "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=o(require("long")),r=o(require("../utils")),t=o(require("../status"));function o(e){return e&&e.__esModule?e:{default:e}}var a=(0,t.default)(),_=function(r,t,o){var _=o.context.root.lookup("easemob.pb.StatisticsBody").decode(r.payload);new e.default(r.id.low,r.id.high,r.id.unsigned).toString();switch(_.operation){case 0:break;case 1:var u={type:a.WEBIM_CONNCTION_USER_REMOVED};o.logOut=!0,o.onError(u);break;case 2:u={type:a.WEBIM_CONNCTION_USER_LOGIN_ANOTHER_DEVICE};o.logOut=!0,o.onError(u);break;case 3:u={type:a.WEBIM_CONNCTION_USER_KICKED_BY_CHANGE_PASSWORD};o.logOut=!0,o.onError(u);break;case 4:u={type:a.WEBIM_CONNCTION_USER_KICKED_BY_OTHER_DEVICE};o.logOut=!0,o.onError(u)}},u=_;exports.default=u;
        },{"long":"YA3p","../utils":"K0yk","../status":"KLYY"}],"h12o":[function(require,module,exports) {
            "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _allnode=_interopRequireDefault(require("./allnode")),_protobufjs=_interopRequireDefault(require("protobufjs")),_sockjsClient=_interopRequireDefault(require("sockjs-client")),_Base=_interopRequireDefault(require("Base64")),_status=_interopRequireDefault(require("./status")),_utils2=_interopRequireDefault(require("./utils")),_message2=_interopRequireDefault(require("./message")),_queue=_interopRequireDefault(require("./queue")),_sendChatMessage=_interopRequireDefault(require("./chat/sendChatMessage")),_handleChatMessage=_interopRequireDefault(require("./chat/handleChatMessage")),_HandleMucMessage=_interopRequireDefault(require("./muc/HandleMucMessage")),_HandleRosterMessage=_interopRequireDefault(require("./roster/HandleRosterMessage")),_HandleStatisticsMessage=_interopRequireDefault(require("./statistics/HandleStatisticsMessage")),_long=_interopRequireDefault(require("long"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}_protobufjs.default.util.Long=_long.default,_protobufjs.default.configure();var _version="3.0.0",all=(0,_allnode.default)(),_code=(0,_status.default)(),_message=_message2.default._msg,_msgHash={},sock,mr_cache={},root=_protobufjs.default.Root.fromJSON(all),Strophe=window.Strophe;window.URL=window.URL||window.webkitURL||window.mozURL||window.msURL;var logMessage=function(e){};window.XDomainRequest;var _listenNetwork=function(e,t){window.addEventListener?(window.addEventListener("online",e),window.addEventListener("offline",t)):window.attachEvent&&(document.body?(document.body.attachEvent("ononline",e),document.body.attachEvent("onoffline",t)):window.attachEvent("load",function(){document.body.attachEvent("ononline",e),document.body.attachEvent("onoffline",t)}))},_parseRoom=function(e){var t=[],o=e.getElementsByTagName("item");if(o)for(var n=0;n<o.length;n++){var s=o[n],r=s.getAttribute("jid"),i=r.split("@")[0],a={jid:r,name:s.getAttribute("name"),roomId:i.split("_")[1]};t.push(a)}return t},_parseRoomOccupants=function(e){var t=[],o=e.getElementsByTagName("item");if(o)for(var n=0;n<o.length;n++){var s=o[n],r={jid:s.getAttribute("jid"),name:s.getAttribute("name")};t.push(r)}return t},_parseNameFromJidFn=function(e,t){return e.name},_getSock=function(e){if("https:"!=location.protocol&&e.isHttpDNS){var t=e.xmppHosts[e.xmppIndex],o=t.domain,n=t.ip,s="";if(n){s=n;var r=t.port;"80"!=r&&(s+=":"+r)}else s=o;s&&(e.url="//"+s+"/ws")}return new _sockjsClient.default(e.url)},_login=function(e,t){if(e)if((sock=_getSock(t)).onopen=function(){var o=[],n=(new Date).valueOf(),s=root.lookup("easemob.pb.Provision"),r=s.decode(o);t.context.jid.clientResource=t.deviceId+"_"+n,r.compressType=t.compressType,r.encryptType=t.encryptType,r.osType=t.osType,r.version=t.version,r.deviceName=t.deviceId,r.resource=t.deviceId+"_"+n,r.deviceUuid=n,r.auth="$t$"+e.access_token,r=s.encode(r).finish();var i=root.lookup("easemob.pb.MSync"),a=i.decode(o);if(a.version=t.version,a.guid=t.context.jid,a.auth="$t$"+e.access_token,a.command=3,a.deviceId=t.deviceId,a.encryptType=t.encryptType,a.payload=r,a=i.encode(a).finish(),base64transform(a),t.logOut=!1,t.offLineSendConnecting=!1,t.unSendMsgArr.length>0)for(var u in t.unSendMsgArr){var c=t.unSendMsgArr[u];t.sendMSync(c),delete t.unSendMsgArr[u]}t.onOpened()},sock.onclose=function(e){if(!t.logOut&&t.autoReconnectNumTotal<=t.autoReconnectNumMax&&(t.autoReconnectNumTotal<=t.xmppHosts.length&&t.isHttpDNS||!t.isHttpDNS)){t.reconnect();var o={type:_code.WEBIM_CONNCTION_DISCONNECTED};t.onError(o),t.onClosed()}},sock.onmessage=function(e){for(var o=_Base.default.atob(e.data),n=[],s=0,r=o.length;s<r;++s)n.push(o.charCodeAt(s));var i=root.lookup("easemob.pb.MSync").decode(n);switch(i.command){case 0:var a=root.lookup("easemob.pb.CommSyncDL");a=a.decode(i.payload);var u=new _long.default(a.serverId.low,a.serverId.high,a.serverId.unsigned).toString(),c=new _long.default(a.metaId.low,a.metaId.high,a.metaId.unsigned).toString();if(0!==a.metas.length)metapayload(a.metas,a.status,t),lastsession(a.nextKey,a.queue,t);else if(a.isLast);else if(a.status&&0===a.status.errorCode){if(_msgHash[c]){try{_msgHash[c].success instanceof Function&&_msgHash[c].success(c,u)}catch(e){t.onError({type:_code.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,data:e})}delete _msgHash[c]}t.onReceivedMessage({id:c,mid:u})}else if(a.status&&15===a.status.errorCode)t.onReceivedMessage({id:c,mid:u}),t.onMutedMessage({mid:u});else if(_msgHash[c]){try{_msgHash[c].fail instanceof Function&&_msgHash[c].fail(c,u)}catch(e){t.onError({type:_code.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,data:e})}delete _msgHash[c]}break;case 1:var p=root.lookup("easemob.pb.CommUnreadDL");if(0===(p=p.decode(i.payload)).unread.length);else for(s=0;s<p.unread.length;s++)backqueue(p.unread[s].queue,t);break;case 2:var l=root.lookup("easemob.pb.CommNotice").decode(i.payload);backqueue(l.queue,t);break;case 3:receiveProvision(i,t)}},""!=(e.access_token||""))t.context.accessToken=e.access_token;else{_utils2.default.stringify(e);t.onError({type:_code.WEBIM_CONNCTION_OPEN_USERGRID_ERROR,data:e})}},lastsession=function(e,t,o){var n=[],s=root.lookup("easemob.pb.CommSyncUL"),r=s.decode(n);r.queue=t,r.key=new _long.default(e.low,e.high,e.unsigned).toString(),r=s.encode(r).finish();var i=root.lookup("easemob.pb.MSync"),a=i.decode(n);if(a.version=o.version,a.encryptType=o.encryptType,a.command=0,a.payload=r,a=i.encode(a).finish(),sock.readyState!==_sockjsClient.default.OPEN){var u={type:_code.WEBIM_CONNCTION_DISCONNECTED};o.onError(u)}else base64transform(a)},metapayload=function(e,t,o){for(var n=0;n<e.length;n++)1===e[n].ns?(0,_handleChatMessage.default)(e[n],t,o):2===e[n].ns?(0,_HandleMucMessage.default)(e[n],t,o):3===e[n].ns?_HandleRosterMessage.default.handleMessage(e[n],t,o):0===e[n].ns?(0,_HandleStatisticsMessage.default)(e[n],t,o):4===e[n].ns&&o.registerConfrIQHandler&&o.registerConfrIQHandler(e[n],t,o)},rebuild=function(){var e=[],t=root.lookup("easemob.pb.StatisticsBody"),o=t.decode(e);o.operation=0,o=t.encode(o).finish();var n=root.lookup("easemob.pb.Meta").decode(e);n.id=(new Date).valueOf(),n.ns=0,n.payload=o;var s=root.lookup("easemob.pb.CommSyncUL"),r=s.decode(e);r.meta=n,r=s.encode(r).finish();var i=root.lookup("easemob.pb.MSync"),a=i.decode(e);a.version="3.0.0",a.encryptType=[0],a.command=0,a.payload=r,a=i.encode(a).finish(),base64transform(a)},backqueue=function(e,t){var o=[],n=root.lookup("easemob.pb.CommSyncUL"),s=n.decode(o);s.queue=e,s=n.encode(s).finish();var r=root.lookup("easemob.pb.MSync"),i=r.decode(o);i.version=t.version,i.encryptType=t.encryptType,i.command=0,i.payload=s,i=r.encode(i).finish(),base64transform(i)},receiveProvision=function(e,t){var o=root.lookup("easemob.pb.Provision").decode(e.payload);t.context.jid.clientResource=o.resource,0==o.status.errorCode&&unreadDeal(t)},unreadDeal=function(e){var t=root.lookup("easemob.pb.MSync"),o=t.decode([]);o.version=e.version,o.encryptType=e.encryptType,o.command=1,o=t.encode(o).finish(),base64transform(o)},base64transform=function(e){for(var t="",o=0;o<e.length;o++){t+=String.fromCharCode(e[o])}t=_Base.default.btoa(t),sock.send(t)},_getJid=function(e,t){var o=e.toJid||{};if(o==={}){var n={appKey:t.context.appKey||"",name:e.to,domain:t.domain,clientResource:t.clientResource};e.resource&&(n.clientResource=e.resource),o=n}return o},_getJidByName=function(e,t){return _getJid({to:e},t)},_validCheck=function(e,t){if(""==(e=e||{}).user)return t.onError({type:_code.WEBIM_CONNCTION_USER_NOT_ASSIGN_ERROR}),!1;var o=e.user+""||"",n=e.appKey||"",s=n.split("#");if(2!==s.length)return t.onError({type:_code.WEBIM_CONNCTION_APPKEY_NOT_ASSIGN_ERROR}),!1;var r=s[0],i=s[1];return r&&i?(t.context.jid={appKey:n,name:o,domain:t.domain,clientResource:t.clientResource},t.context.root=root,t.context.userId=o,t.context.appKey=n,t.context.appName=i,t.context.orgName=r,!0):(t.onError({type:_code.WEBIM_CONNCTION_APPKEY_NOT_ASSIGN_ERROR}),!1)},connection=function e(t){if(!this instanceof e)return new e(t);t=t||{};this.isHttpDNS=t.isHttpDNS||!1,this.isMultiLoginSessions=t.isMultiLoginSessions||!1,this.wait=t.wait||30,this.retry=t.retry||!1,this.https=t.https&&"https:"===location.protocol,this.url=t.url,this.hold=t.hold||1,this.route=t.route||null,this.inactivity=t.inactivity||30,this.heartBeatWait=t.heartBeatWait||4500,this.maxRetries=t.maxRetries||5,this.isAutoLogin=!1!==t.isAutoLogin,this.pollingTime=t.pollingTime||800,this.stropheConn=!1,this.autoReconnectNumMax=t.autoReconnectNumMax||0,this.autoReconnectNumTotal=0,this.autoReconnectInterval=t.autoReconnectInterval||0,this.context={status:_code.STATUS_INIT},this.sendQueue=new _queue.default,this.intervalId=null,this.apiUrl=t.apiUrl||"",this.isWindowSDK=t.isWindowSDK||!1,this.encrypt=t.encrypt||{encrypt:{type:"none"}},this.delivery=t.delivery||!1,this.appKey=t.appKey||"easemob-demo#chatdemoui",this.domain=t.domain||"easemob.com",this.clientResource="84ff3eba1",this.user="",this.orgName="",this.appName="",this.token="",this.unSendMsgArr=[],this.dnsArr=["https://rs.easemob.com","http://182.92.174.78","http://112.126.66.111"],this.dnsIndex=0,this.dnsTotal=this.dnsArr.length,this.restHosts=[],this.restIndex=0,this.restTotal=0,this.xmppHosts=[],this.xmppIndex=0,this.xmppTotal=0,this.groupOption={},this.version=t.version||"3.0.0",this.compressAlgorimth=t.compressAlgorimth||0,this.userAgent=t.userAgent||0,this.pov=t.pov||0,this.command=t.command||3,this.deviceId=t.deviceId||"webim",this.encryptKey=t.encryptKey||"",this.firstPayload=t.firstPayload||[],this.compressType=t.compressType||[0],this.encryptType=t.encryptType||[0],this.osType=16,window.this=this};connection.prototype.registerUser=function(e){"https:"!=location.protocol&&this.isHttpDNS?(this.dnsIndex=0,this.getHttpDNS(e,"signup")):this.signup(e)},connection.prototype.listen=function(e){this.onOpened=e.onOpened||_utils2.default.emptyfn,this.onClosed=e.onClosed||_utils2.default.emptyfn,this.onTextMessage=e.onTextMessage||_utils2.default.emptyfn,this.onEmojiMessage=e.onEmojiMessage||_utils2.default.emptyfn,this.onPictureMessage=e.onPictureMessage||_utils2.default.emptyfn,this.onAudioMessage=e.onAudioMessage||_utils2.default.emptyfn,this.onVideoMessage=e.onVideoMessage||_utils2.default.emptyfn,this.onFileMessage=e.onFileMessage||_utils2.default.emptyfn,this.onLocationMessage=e.onLocationMessage||_utils2.default.emptyfn,this.onCmdMessage=e.onCmdMessage||_utils2.default.emptyfn,this.onPresence=e.onPresence||_utils2.default.emptyfn,this.onRoster=e.onRoster||_utils2.default.emptyfn,this.onError=e.onError||_utils2.default.emptyfn,this.onReceivedMessage=e.onReceivedMessage||_utils2.default.emptyfn,this.onInviteMessage=e.onInviteMessage||_utils2.default.emptyfn,this.onDeliverdMessage=e.onDeliveredMessage||_utils2.default.emptyfn,this.onReadMessage=e.onReadMessage||_utils2.default.emptyfn,this.onRecallMessage=e.onRecallMessage||_utils2.default.emptyfn,this.onMutedMessage=e.onMutedMessage||_utils2.default.emptyfn,this.onOffline=e.onOffline||_utils2.default.emptyfn,this.onOnline=e.onOnline||_utils2.default.emptyfn,this.onConfirmPop=e.onConfirmPop||_utils2.default.emptyfn,this.onCreateGroup=e.onCreateGroup||_utils2.default.emptyfn,this.onUpdateMyGroupList=e.onUpdateMyGroupList||_utils2.default.emptyfn,this.onUpdateMyRoster=e.onUpdateMyRoster||_utils2.default.emptyfn,this.onBlacklistUpdate=e.onBlacklistUpdate||_utils2.default.emptyfn,_listenNetwork(this.onOnline,this.onOffline)},connection.prototype.getRestFromHttpDNS=function(e,t){if(!(this.restIndex>this.restTotal)){var o="",n=this.restHosts[this.restIndex],s=n.domain,r=n.ip;if(r){var i=n.port;o=("https:"===location.protocol?"https:":"http:")+"//"+r+":"+i}else o=("https:"===location.protocol?"https:":"http:")+"//"+s;""!=o&&(this.apiUrl=o,e.apiUrl=o),"login"==t?this.login(e):this.signup(e)}},connection.prototype.getHttpDNS=function(e,t){var o=this,n={url:this.dnsArr[this.dnsIndex]+"/easemob/server.json",dataType:"json",type:"GET",data:{app_key:encodeURIComponent(e.appKey||this.appKey)},success:function(n,s){var r=n.rest.hosts;if(r){for(var i=o.https?"https":"http",a=0;a<r.length;a++)if(r[a].protocol===i){var u=r[a];r.splice(a,1),r.unshift(u)}o.restHosts=r,o.restTotal=r.length;try{Array.prototype.slice.call(document.documentElement.childNodes,0)[0].nodeType}catch(p){}var c=n["msync-ws"].hosts;if(c){for(a=0;a<c.length;a++)c[a].protocol===i&&(u=c[a],c.splice(a,1),c.unshift(u));o.xmppHosts=c,o.xmppTotal=c.length,o.getRestFromHttpDNS(e,t)}}}||_utils2.default.emptyfn,error:function(n,s,r){console.log("getHttpDNS error",n,r),o.dnsIndex++,o.dnsIndex<o.dnsTotal&&o.getHttpDNS(e,t)}||_utils2.default.emptyfn};_utils2.default.ajax(n)},connection.prototype.signup=function(e){var t=this,o=e.orgName||"",n=e.appName||"",s=e.appKey||this.appKey,r=e.success||_utils2.default.emptyfn,i=e.error||_utils2.default.emptyfn;if(!o&&!n&&s){var a=s.split("#");2===a.length&&(o=a[0],n=a[1])}if(o||n){e.https||this.https;var u=(e.apiUrl||this.apiUrl)+"/"+o+"/"+n+"/users",c={username:e.username,password:e.password,nickname:e.nickname||""},p={url:u,dataType:"json",data:_utils2.default.stringify(c),success:r,error:function(o,n,s){if("https:"!=location.protocol&&t.isHttpDNS&&t.restIndex+1<t.restTotal)return t.restIndex++,void t.getRestFromHttpDNS(e,"signup");t.clear(),i(o)}};_utils2.default.ajax(p)}else i({type:_code.WEBIM_CONNCTION_APPKEY_NOT_ASSIGN_ERROR})},connection.prototype.open=function(e){var t=e.appKey,o=t.split("#")[0],n=t.split("#")[1];this.orgName=o,this.appName=n,e.accessToken&&(this.token=e.accessToken),"https:"!=location.protocol&&this.isHttpDNS?(this.dnsIndex=0,this.getHttpDNS(e,"login")):this.login(e)},connection.prototype.login=function(e){if(this.user=e.user,_validCheck(e,this)){var t=this;if(!t.isOpened())if(e.accessToken)e.access_token=e.accessToken,_login(e,t);else{var o=e.apiUrl,n=this.context.userId,s=e.pwd||"",r=this.context.appName,i=this.context.orgName,a={grant_type:"password",username:n,password:s,timestamp:+new Date},u={url:o+"/"+i+"/"+r+"/token",dataType:"json",data:_utils2.default.stringify(a),success:function(o,n){e.success&&e.success(o),t.token=o.access_token,t.context.restTokenData=o.access_token,_login(o,t)}||_utils2.default.emptyfn,error:function(o,n,s){if(e.error&&e.error(),"https:"!=location.protocol&&t.isHttpDNS&&t.restIndex+1<t.restTotal)return t.restIndex++,void t.getRestFromHttpDNS(e,"login");t.clear(),o.error&&o.error_description?t.onError({type:_code.WEBIM_CONNCTION_OPEN_USERGRID_ERROR,data:o,xhr:n}):t.onError({type:_code.WEBIM_CONNCTION_OPEN_ERROR,data:o,xhr:n})}||_utils2.default.emptyfn};_utils2.default.ajax(u)}}},connection.prototype.close=function(e){this.logOut=!0,this.context.status=_code.STATUS_CLOSING,sock.close(),this.context.status=_code.STATUS_CLOSING},connection.prototype.recallMessage=function(e){var t={id:this.getUniqueId(),type:"recall",group:e.type,ackId:e.mid,to:e.to,success:e.success,fail:e.fail};this.send(t,this)},connection.prototype.sendMSync=function(e){for(var t="",o=0;o<e.length;o++){t+=String.fromCharCode(e[o])}t=_Base.default.btoa(t),sock.readyState===_sockjsClient.default.OPEN?sock.send(t):(this.unSendMsgArr.push(t),!this.logOut&&this.autoReconnectNumTotal<=this.autoReconnectNumMax&&(this.autoReconnectNumTotal<=this.xmppHosts.length&&this.isHttpDNS||!this.isHttpDNS)&&(this.offLineSendConnecting=!0,this.reconnect()),this.onError({type:_code.WEBIM_CONNCTION_DISCONNECTED,reconnect:!0}))},connection.prototype.getUniqueId=function(e){this.autoIncrement?this.autoIncrement++:this.autoIncrement=1;var t=new Date,o=new Date(2010,1,1);return t.getTime()-o.getTime()+this.autoIncrement},connection.prototype.send=function(e){(0,_sendChatMessage.default)(e,this),_msgHash[e.id]=e},connection.prototype.addRoster=function(e){var t=_getJid(e,this),o=e.name||"",n=e.groups||"",s=$iq({type:"set"});if(s.c("query",{xmlns:"jabber:iq:roster"}),s.c("item",{jid:t,name:o}),n)for(var r=0;r<n.length;r++)s.c("group").t(n[r]).up();var i=e.success||_utils2.default.emptyfn,a=e.error||_utils2.default.emptyfn;this.context.stropheConn.sendIQ(s.tree(),i,a)},connection.prototype.removeRoster=function(e){_HandleRosterMessage.default.operatRoster(e,"remove",this)},connection.prototype.getRoster=function(e){e=e||{};var t=this;if(_utils2.default.isCanSetRequestHeader){var o=this,n=e.accessToken||this.token;if(n){var s=e.apiUrl||this.apiUrl,r=this.context.appName,i=this.context.orgName;if(!r||!i)return void o.onError({type:_code.WEBIM_CONNCTION_AUTH_ERROR});var a={url:s+"/"+i+"/"+r+"/users/"+this.user+"/contacts/users",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+n},success:function(o,n){var s=[];o.data.forEach(function(e,o){s.push({name:e,subscription:"both",jid:t.context.jid})}),"function"==typeof e.success&&e.success(s),this.onRoster&&this.onRoster()}||_utils2.default.emptyfn,error:function(t,o,n){"function"==typeof e.error&&e.error(t)}||_utils2.default.emptyfn};_utils2.default.ajax(a)}else o.onError({type:_code.WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR})}else o.onError({type:_code.WEBIM_CONNCTION_NOT_SUPPORT_CHATROOM_ERROR})},connection.prototype.subscribe=function(e){_HandleRosterMessage.default.operatRoster(e,"add",this)},connection.prototype.subscribed=function(e){_HandleRosterMessage.default.operatRoster(e,"accept",this)},connection.prototype.unsubscribe=function(e){var t=_getJid(e,this),o=$pres({to:t,type:"unsubscribe"});e.message&&o.c("status").t(e.message),this.sendCommand(o.tree())},connection.prototype.unsubscribed=function(e){_HandleRosterMessage.default.operatRoster(e,"decline",this)},connection.prototype.joinPublicGroup=function(e){var t=this.context.appKey+"_"+e.roomId+"@conference."+this.domain+"/"+this.context.userId,o=e.success||_utils2.default.emptyfn,n=e.error||_utils2.default.emptyfn,s=$pres({from:this.context.jid,to:t}).c("x",{xmlns:Strophe.NS.MUC});this.context.stropheConn.sendIQ(s.tree(),o,function(e){n({type:_code.WEBIM_CONNCTION_JOINROOM_ERROR,data:e})})},connection.prototype.listRooms=function(e){var t=$iq({to:e.server||"conference."+this.domain,from:this.context.jid,type:"get"}).c("query",{xmlns:Strophe.NS.DISCO_ITEMS}),o=e.success||_utils2.default.emptyfn,n=e.error||this.onError,s=e.error||_utils2.default.emptyfn;this.context.stropheConn.sendIQ(t.tree(),function(e){var t;t=_parseRoom(e);try{o(t)}catch(s){n({type:_code.WEBIM_CONNCTION_GETROOM_ERROR,data:s})}},function(e){s({type:_code.WEBIM_CONNCTION_GETROOM_ERROR,data:e})})},connection.prototype.queryRoomMember=function(e){this.domain;var t=[],o=$iq({to:this.context.appKey+"_"+e.roomId+"@conference."+this.domain,type:"get"}).c("query",{xmlns:Strophe.NS.MUC+"#admin"}).c("item",{affiliation:"member"}),n=e.success||_utils2.default.emptyfn,s=e.error||_utils2.default.emptyfn;this.context.stropheConn.sendIQ(o.tree(),function(e){var o=e.getElementsByTagName("item");if(o)for(var s=0;s<o.length;s++){var r={jid:o[s].getAttribute("jid"),affiliation:"member"};t.push(r)}n(t)},function(e){s({type:_code.WEBIM_CONNCTION_GETROOMMEMBER_ERROR,data:e})})},connection.prototype.queryRoomInfo=function(e){var t=this.domain,o=$iq({to:this.context.appKey+"_"+e.roomId+"@conference."+t,type:"get"}).c("query",{xmlns:Strophe.NS.DISCO_INFO}),n=e.success||_utils2.default.emptyfn,s=[],r=e.error||_utils2.default.emptyfn;this.context.stropheConn.sendIQ(o.tree(),function(e){var o="",r=e.getElementsByTagName("feature");switch(r&&(o=r[1].getAttribute("var")+"|"+r[3].getAttribute("var")+"|"+r[4].getAttribute("var")),o){case"muc_public|muc_membersonly|muc_notallowinvites":o="PUBLIC_JOIN_APPROVAL";break;case"muc_public|muc_open|muc_notallowinvites":o="PUBLIC_JOIN_OPEN";break;case"muc_hidden|muc_membersonly|muc_allowinvites":o="PRIVATE_MEMBER_INVITE";break;case"muc_hidden|muc_membersonly|muc_notallowinvites":o="PRIVATE_OWNER_INVITE"}var i=e.getElementsByTagName("field"),a={};if(i){for(var u=0;u<i.length;u++){var c=i[u],p=c.getAttribute("var"),l=p.split("_")[1];switch(p){case"muc#roominfo_occupants":case"muc#roominfo_maxusers":case"muc#roominfo_affiliations":case"muc#roominfo_description":a[l]=c.textContent||c.text||"";break;case"muc#roominfo_owner":var d={jid:(c.textContent||c.text)+"@"+t,affiliation:"owner"};s.push(d),a[l]=c.textContent||c.text}}a.name=e.getElementsByTagName("identity")[0].getAttribute("name")}n(o,s,a)},function(e){r({type:_code.WEBIM_CONNCTION_GETROOMINFO_ERROR,data:e})})},connection.prototype.queryRoomOccupants=function(e){var t=e.success||_utils2.default.emptyfn,o=e.error||_utils2.default.emptyfn,n={xmlns:Strophe.NS.DISCO_ITEMS},s=$iq({from:this.context.jid,to:this.context.appKey+"_"+e.roomId+"@conference."+this.domain,type:"get"}).c("query",n);this.context.stropheConn.sendIQ(s.tree(),function(e){var o;o=_parseRoomOccupants(e),t(o)},function(e){o({type:_code.WEBIM_CONNCTION_GETROOMOCCUPANTS_ERROR,data:e})})},connection.prototype.isOpened=function(){return sock&&sock.readyState===_sockjsClient.default.OPEN},connection.prototype.clear=function(){var e=this.context.appKey;if(this.errorType!=_code.WEBIM_CONNCTION_DISCONNECTED&&this.logOut&&(this.unSendMsgArr=[],this.offLineSendConnecting=!1,this.context={status:_code.STATUS_INIT,appKey:e}),this.intervalId&&clearInterval(this.intervalId),this.restIndex=0,this.xmppIndex=0,this.errorType==_code.WEBIM_CONNCTION_CLIENT_LOGOUT||-1==this.errorType){var t={data:{data:"logout"},type:_code.WEBIM_CONNCTION_CLIENT_LOGOUT};this.onError(t)}};var _fetchMessages=function(e,t){var o=e.accessToken||t.context.accessToken;if(_utils2.default.isCanSetRequestHeader)if(o){var n=t.apiUrl,s=t.context.appName,r=t.context.orgName;if(!s||!r)return void t.onError({type:_code.WEBIM_CONNCTION_AUTH_ERROR});if(!e.queue)return void t.onError({type:"",msg:"queue is not specified"});var i=e.queue,a=mr_cache[i]||(mr_cache[i]={msgs:[]}),u=t.context.userId,c=-1;if(a.msgs.length>=e.count||a.is_last)return void("function"==typeof e.success&&e.success(a));a&&a.next_key&&(c=a.next_key);var p={queue:i+(e.isGroup?"@conference.easemob.com":"@easemob.com"),start:c,end:-1},l={url:n+"/"+r+"/"+s+"/users/"+u+"/messageroaming",dataType:"json",type:"POST",headers:{Authorization:"Bearer "+o},data:JSON.stringify(p),success:function(o,n){if(o&&o.data){var s=o.data,r=s.msgs,i=r.length;a.is_last=s.is_last,a.next_key=s.next_key;var u=function(e){for(var o=[],n=0,s=(e=_Base.default.atob(e)).length;n<s;++n)o.push(e.charCodeAt(n));var r=t.context.root.lookup("easemob.pb.Meta");if(1==(r=r.decode(o)).ns)return(0,_handleChatMessage.default)(r,{errorCode:0,reason:""},t,!0)};try{for(var c=0;c<i;c++){var p=u(r[c].msg);p&&a.msgs.push(p)}}catch(l){console.log(l)}finally{"function"==typeof e.success&&e.success(a)}}}||_utils2.default.emptyfn,error:function(e,o){e.error&&e.error_description&&t.onError({type:_code.WEBIM_CONNCTION_LOAD_CHATROOM_ERROR,msg:e.error_description,data:e})}||_utils2.default.emptyfn};_utils2.default.ajax(l)}else t.onError({type:_code.WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR});else t.onError({type:_code.WEBIM_CONNCTION_NOT_SUPPORT_CHATROOM_ERROR})};function _parsePrivacy(e){var t={},o=e.getElementsByTagName("item");if(o)for(var n=0;n<o.length;n++){var s=o[n],r=s.getAttribute("value"),i=s.getAttribute("order"),a=s.getAttribute("type");if(r){var u=_parseNameFromJidFn(r);t[u]={type:a,order:i,jid:r,name:u}}}return t}function _parseGroupBlacklist(e){var t={},o=e.getElementsByTagName("item");if(o)for(var n=0;n<o.length;n++){var s=o[n],r=s.getAttribute("jid"),i=s.getAttribute("affiliation"),a=s.getAttribute("nick");if(r){var u=_parseNameFromJidFn(r);t[u]={jid:r,affiliation:i,nick:a,name:u}}}return t}connection.prototype.fetchHistoryMessages=function(e){var t=this;if(e.queue){var o=e.count||20;!function n(){_fetchMessages({count:o,isGroup:!!e.isGroup,queue:e.queue,success:function(t){t.msgs.length>=o||t.is_last?e.success&&e.success(_utils2.default.reverse(t.msgs.splice(0,o))):n()}},t)}()}else t.onError({type:"",msg:"queue is not specified"})},connection.prototype.getChatRooms=function(e){if(_utils2.default.isCanSetRequestHeader){var t=this,o=e.accessToken||this.context.accessToken;if(o){var n=e.apiUrl,s=this.context.appName,r=this.context.orgName;if(!s||!r)return void t.onError({type:_code.WEBIM_CONNCTION_AUTH_ERROR});var i={url:n+"/"+r+"/"+s+"/chatrooms",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+o},data:{pagenum:parseInt(e.pagenum)||1,pagesize:parseInt(e.pagesize)||20},success:function(t,o){"function"==typeof e.success&&e.success(t)}||_utils2.default.emptyfn,error:function(e,o,n){e.error&&e.error_description&&t.onError({type:_code.WEBIM_CONNCTION_LOAD_CHATROOM_ERROR,msg:e.error_description,data:e,xhr:o})}||_utils2.default.emptyfn};_utils2.default.ajax(i)}else t.onError({type:_code.WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR})}else t.onError({type:_code.WEBIM_CONNCTION_NOT_SUPPORT_CHATROOM_ERROR})},connection.prototype.joinChatRoom=function(e){e=e||{};if(_utils2.default.isCanSetRequestHeader){var t=this,o=e.accessToken||this.token;if(o){var n=e.apiUrl||this.apiUrl,s=this.context.appName,r=this.context.orgName,i=e.roomId,a=e.message||"";if(!s||!r)return void t.onError({type:_code.WEBIM_CONNCTION_AUTH_ERROR});var u={url:n+"/"+r+"/"+s+"/chatrooms/"+i+"/apply",dataType:"json",type:"POST",data:JSON.stringify({message:a}),headers:{Authorization:"Bearer "+o,"Content-Type":"application/json"},success:function(t,o){"function"==typeof e.success&&e.success(t)}||_utils2.default.emptyfn,error:function(t,o,n){"function"==typeof e.error&&e.error(t)}||_utils2.default.emptyfn};_utils2.default.ajax(u)}else t.onError({type:_code.WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR})}else t.onError({type:_code.WEBIM_CONNCTION_NOT_SUPPORT_CHATROOM_ERROR})},connection.prototype.quitChatRoom=function(e){e=e||{};if(_utils2.default.isCanSetRequestHeader){var t=this,o=e.accessToken||this.token;if(o){var n=e.apiUrl||this.apiUrl,s=this.context.appName,r=this.context.orgName,i=e.roomId;if(!s||!r)return void t.onError({type:_code.WEBIM_CONNCTION_AUTH_ERROR});var a={url:n+"/"+r+"/"+s+"/chatrooms/"+i+"/quit",dataType:"json",type:"DELETE",headers:{Authorization:"Bearer "+o},success:function(t,o){"function"==typeof e.success&&e.success(t)}||_utils2.default.emptyfn,error:function(t,o,n){"function"==typeof e.error&&e.error(t)}||_utils2.default.emptyfn};_utils2.default.ajax(a)}else t.onError({type:_code.WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR})}else t.onError({type:_code.WEBIM_CONNCTION_NOT_SUPPORT_CHATROOM_ERROR})},connection.prototype._onReceiveInviteFromGroup=function(info){info=eval("("+info+")");var self=this,options={title:"Group invitation",msg:info.user+" invites you to join into group:"+info.group_id,agree:function(){WebIM.doQuery('{"type":"acceptInvitationFromGroup","id":"'+info.group_id+'","user":"'+info.user+'"}',function(e){},function(e,t){var o={data:{data:"acceptInvitationFromGroup error:"+t},type:_code.WEBIM_CONNECTION_ACCEPT_INVITATION_FROM_GROUP};self.onError(o)})},reject:function(){WebIM.doQuery('{"type":"declineInvitationFromGroup","id":"'+info.group_id+'","user":"'+info.user+'"}',function(e){},function(e,t){var o={data:{data:"declineInvitationFromGroup error:"+t},type:_code.WEBIM_CONNECTION_DECLINE_INVITATION_FROM_GROUP};self.onError(o)})}};this.onConfirmPop(options)},connection.prototype._onReceiveInviteAcceptionFromGroup=function(info){info=eval("("+info+")");var options={title:"Group invitation response",msg:info.user+" agreed to join into group:"+info.group_id,agree:function(){}};this.onConfirmPop(options)},connection.prototype._onReceiveInviteDeclineFromGroup=function(info){info=eval("("+info+")");var options={title:"Group invitation response",msg:info.user+" rejected to join into group:"+info.group_id,agree:function(){}};this.onConfirmPop(options)},connection.prototype._onAutoAcceptInvitationFromGroup=function(info){info=eval("("+info+")");var options={title:"Group invitation",msg:"You had joined into the group:"+info.group_name+" automatically.Inviter:"+info.user,agree:function(){}};this.onConfirmPop(options)},connection.prototype._onLeaveGroup=function(info){info=eval("("+info+")");var options={title:"Group notification",msg:"You have been out of the group:"+info.group_id+".Reason:"+info.msg,agree:function(){}};this.onConfirmPop(options)},connection.prototype._onReceiveJoinGroupApplication=function(info){info=eval("("+info+")");var self=this,options={title:"Group join application",msg:info.user+" applys to join into group:"+info.group_id,agree:function(){WebIM.doQuery('{"type":"acceptJoinGroupApplication","id":"'+info.group_id+'","user":"'+info.user+'"}',function(e){},function(e,t){var o={data:{data:"acceptJoinGroupApplication error:"+t},type:_code.WEBIM_CONNECTION_ACCEPT_JOIN_GROUP};self.onError(o)})},reject:function(){WebIM.doQuery('{"type":"declineJoinGroupApplication","id":"'+info.group_id+'","user":"'+info.user+'"}',function(e){},function(e,t){var o={data:{data:"declineJoinGroupApplication error:"+t},type:_code.WEBIM_CONNECTION_DECLINE_JOIN_GROUP};self.onError(o)})}};this.onConfirmPop(options)},connection.prototype._onReceiveAcceptionFromGroup=function(info){info=eval("("+info+")");var options={title:"Group notification",msg:"You had joined into the group:"+info.group_name+".",agree:function(){}};this.onConfirmPop(options)},connection.prototype._onReceiveRejectionFromGroup=function(){info=eval("("+info+")");var options={title:"Group notification",msg:"You have been rejected to join into the group:"+info.group_name+".",agree:function(){}};this.onConfirmPop(options)},connection.prototype._onUpdateMyGroupList=function(e){this.onUpdateMyGroupList(e)},connection.prototype._onUpdateMyRoster=function(e){this.onUpdateMyRoster(e)},connection.prototype.reconnect=function(e){var t=this;t.xmppIndex<t.xmppHosts.length-1&&t.xmppIndex++,setTimeout(function(){_login({access_token:t.context.accessToken},t)},1e3*(0==this.autoReconnectNumTotal?0:this.autoReconnectInterval)),this.autoReconnectNumTotal++},connection.prototype.closed=function(){var e={data:{data:"Closed error"},type:_code.WEBIM_CONNECTION_CLOSED};this.onError(e)},connection.prototype.getBlacklistOld=function(e){e=e||{};var t=$iq({type:"get"}),o=e.success||_utils2.default.emptyfn,n=e.error||_utils2.default.emptyfn,s=this;t.c("query",{xmlns:"jabber:iq:privacy"}).c("list",{name:"special"}),this.context.stropheConn.sendIQ(t.tree(),function(e){s.onBlacklistUpdate(_parsePrivacy(e)),o()},function(){s.onBlacklistUpdate([]),n()})},connection.prototype.getBlacklist=function(e){var t=this;e=e||{};if(_utils2.default.isCanSetRequestHeader){var o=this,n=e.accessToken||this.token;if(n){var s=e.apiUrl||this.apiUrl,r=this.context.appName,i=this.context.orgName;if(!r||!i)return void o.onError({type:_code.WEBIM_CONNCTION_AUTH_ERROR});var a={url:s+"/"+i+"/"+r+"/users/"+this.user+"/blocks/users",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+n},success:function(o,n){var s={};o.data.forEach(function(e,t){s[e]={name:e}}),t.onBlacklistUpdate(s),"function"==typeof e.success&&e.success(o)}||_utils2.default.emptyfn,error:function(o,n,s){t.onBlacklistUpdate([]),"function"==typeof e.error&&e.error(o)}||_utils2.default.emptyfn};_utils2.default.ajax(a)}else o.onError({type:_code.WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR})}else o.onError({type:_code.WEBIM_CONNCTION_NOT_SUPPORT_CHATROOM_ERROR})},connection.prototype.addToBlackList=function(e){_HandleRosterMessage.default.operatRoster({to:e.name},"ban",this)},connection.prototype.removeFromBlackList=function(e){_HandleRosterMessage.default.operatRoster({to:e.name},"allow",this)},connection.prototype._getGroupJid=function(e){return(this.context.appKey||"")+"_"+e+"@conference."+this.domain},connection.prototype.addToGroupBlackList=function(e){var t=e.success||_utils2.default.emptyfn,o=e.error||_utils2.default.emptyfn,n=_getJid(e,this),s=this._getGroupJid(e.roomId),r=$iq({type:"set",to:s});r.c("query",{xmlns:"http://jabber.org/protocol/muc#admin"}).c("item",{affiliation:"outcast",jid:n}),this.context.stropheConn.sendIQ(r.tree(),t,o)},connection.prototype.getGroupBlacklist=function(e){var t=e.success||_utils2.default.emptyfn,o=e.error||_utils2.default.emptyfn,n=this._getGroupJid(e.roomId),s=$iq({type:"get",to:n});s.c("query",{xmlns:"http://jabber.org/protocol/muc#admin"}).c("item",{affiliation:"outcast"}),this.context.stropheConn.sendIQ(s.tree(),function(e){t(_parseGroupBlacklist(e))},function(){o()})},connection.prototype.removeGroupMemberFromBlacklist=function(e){var t=e.success||_utils2.default.emptyfn,o=e.error||_utils2.default.emptyfn,n=_getJid(e,this),s=this._getGroupJid(e.roomId),r=$iq({type:"set",to:s});r.c("query",{xmlns:"http://jabber.org/protocol/muc#admin"}).c("item",{affiliation:"none",jid:n}),this.context.stropheConn.sendIQ(r.tree(),function(e){t()},function(){o()})},connection.prototype.changeGroupSubject=function(e){var t=e.success||_utils2.default.emptyfn,o=e.error||_utils2.default.emptyfn,n=this._getGroupJid(e.roomId),s=$iq({type:"set",to:n});s.c("query",{xmlns:"http://jabber.org/protocol/muc#owner"}).c("x",{type:"submit",xmlns:"jabber:x:data"}).c("field",{var:"FORM_TYPE"}).c("value").t("http://jabber.org/protocol/muc#roomconfig").up().up().c("field",{var:"muc#roomconfig_roomname"}).c("value").t(e.subject).up().up().c("field",{var:"muc#roomconfig_roomdesc"}).c("value").t(e.description),this.context.stropheConn.sendIQ(s.tree(),function(e){t()},function(){o()})},connection.prototype.destroyGroup=function(e){var t=e.success||_utils2.default.emptyfn,o=e.error||_utils2.default.emptyfn,n=this._getGroupJid(e.roomId),s=$iq({type:"set",to:n});s.c("query",{xmlns:"http://jabber.org/protocol/muc#owner"}).c("destroy").c("reason").t(e.reason||""),this.context.stropheConn.sendIQ(s.tree(),function(e){t()},function(){o()})},connection.prototype.leaveGroupBySelf=function(e){var t=this,o=e.success||_utils2.default.emptyfn,n=e.error||_utils2.default.emptyfn,s=_getJid(e,this),r=this._getGroupJid(e.roomId),i=$iq({type:"set",to:r});i.c("query",{xmlns:"http://jabber.org/protocol/muc#admin"}).c("item",{affiliation:"none",jid:s}),this.context.stropheConn.sendIQ(i.tree(),function(e){o(e);var n=$pres({type:"unavailable",to:r+"/"+t.context.userId});t.sendCommand(n.tree())},function(e){n(e)})},connection.prototype.leaveGroup=function(e){for(var t=e.success||_utils2.default.emptyfn,o=e.error||_utils2.default.emptyfn,n=e.list||[],s=this._getGroupJid(e.roomId),r=$iq({type:"set",to:s}),i=r.c("query",{xmlns:"http://jabber.org/protocol/muc#admin"}),a=Object.keys(n),u=a.length,c=0;c<u;c++){var p=n[a[c]],l=_getJidByName(p,this);i=i.c("item",{affiliation:"none",jid:l}).up().c("item",{role:"none",jid:l}).up()}this.context.stropheConn.sendIQ(r.tree(),function(e){t(e)},function(e){o(e)})},connection.prototype.addGroupMembers=function(e){for(var t=e.success||_utils2.default.emptyfn,o=e.error||_utils2.default.emptyfn,n=e.list||[],s=this._getGroupJid(e.roomId),r=$iq({type:"set",to:s}),i=r.c("query",{xmlns:"http://jabber.org/protocol/muc#admin"}),a=n.length,u=0;u<a;u++){var c=n[u],p=_getJidByName(c,this);i=i.c("item",{affiliation:"member",jid:p}).up();var l=$msg({to:s}).c("x",{xmlns:"http://jabber.org/protocol/muc#user"}).c("invite",{to:p}).c("reason").t(e.reason||"");this.sendCommand(l.tree())}this.context.stropheConn.sendIQ(r.tree(),function(e){t(e)},function(e){o(e)})},connection.prototype.acceptInviteFromGroup=function(e){e.success=function(){},this.addGroupMembers(e)},connection.prototype.rejectInviteFromGroup=function(e){},connection.prototype.createGroupAsync=function(e){var t=e.from,o=this,n=this._getGroupJid(t),s=(this.context.userId,this.groupOption),r=e.success||_utils2.default.emptyfn,i=$iq({type:"get",to:n}).c("query",{xmlns:"http://jabber.org/protocol/muc#owner"});o.context.stropheConn.sendIQ(i.tree(),function(e){if("setAttribute"in e){var i=e.getElementsByTagName("x")[0];i.setAttribute("type","submit")}else Strophe.forEachChild(e,"x",function(e){e.setAttribute("type","submit")});Strophe.info("step 5 ----------"),Strophe.forEachChild(i,"field",function(e){var t=e.getAttribute("var"),o=e.getElementsByTagName("value")[0];switch(Strophe.info(t),t){case"muc#roomconfig_maxusers":_setText(o,s.optionsMaxUsers||200);break;case"muc#roomconfig_roomname":_setText(o,s.subject||"");break;case"muc#roomconfig_roomdesc":_setText(o,s.description||"");break;case"muc#roomconfig_publicroom":_setText(o,+s.optionsPublic);break;case"muc#roomconfig_membersonly":_setText(o,+s.optionsMembersOnly);break;case"muc#roomconfig_moderatedroom":_setText(o,+s.optionsModerate);break;case"muc#roomconfig_persistentroom":_setText(o,1);break;case"muc#roomconfig_allowinvites":_setText(o,+s.optionsAllowInvites);break;case"muc#roomconfig_allowvisitornickchange":case"muc#roomconfig_allowvisitorstatus":case"allow_private_messages":_setText(o,0);break;case"allow_private_messages_from_visitors":_setText(o,"nobody")}});var a=$iq({to:n,type:"set"}).c("query",{xmlns:"http://jabber.org/protocol/muc#owner"}).cnode(i);o.context.stropheConn.sendIQ(a.tree(),function(e){o.addGroupMembers({list:s.members,roomId:t}),r(s)},function(e){})},function(e){})},connection.prototype.createGroup=function(e){this.groupOption=e;var t=+new Date,o=this._getGroupJid(t)+"/"+this.context.userId,n=$pres({to:o}).c("x",{xmlns:"http://jabber.org/protocol/muc"}).up().c("create",{xmlns:"http://jabber.org/protocol/muc"}).up();this.sendCommand(n.tree())},connection.prototype.createGroupNew=function(e){e.data.owner=this.user,e.data.invite_need_confirm=!1;var t={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups",dataType:"json",type:"POST",data:JSON.stringify(e.data),headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};t.success=function(t){e.success(t),this.onCreateGroup(t)}.bind(this),t.error=e.error||_utils2.default.emptyfn,WebIM.utils.ajax(t)},connection.prototype.blockGroup=function(e){var t=e.groupId;t="notification_ignore_"+t;var o={entities:[]};o.entities[0]={},o.entities[0][t]=!0;var n={type:"PUT",url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/users/"+this.user,data:JSON.stringify(o),headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};n.success=e.success||_utils2.default.emptyfn,n.error=e.error||_utils2.default.emptyfn,WebIM.utils.ajax(n)},connection.prototype.listGroups=function(e){var t=[];if(t.limit=e.limit,t.cursor=e.cursor,t.cursor||delete t.cursor,isNaN(e.limit))throw'The parameter "limit" should be a number';var o={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/publicchatgroups",type:"GET",dataType:"json",data:t,headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};o.success=e.success||_utils2.default.emptyfn,o.error=e.error||_utils2.default.emptyfn,WebIM.utils.ajax(o)},connection.prototype.getGroup=function(e){var t={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/users/"+this.user+"/joined_chatgroups",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};t.success=e.success||_utils2.default.emptyfn,t.error=e.error||_utils2.default.emptyfn,WebIM.utils.ajax(t)},connection.prototype.changeOwner=function(e){var t={newowner:e.newOwner},o={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+e.groupId,type:"PUT",dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"},data:JSON.stringify(t)};o.success=e.success||_utils2.default.emptyfn,o.error=e.error||_utils2.default.emptyfn,WebIM.utils.ajax(o)},connection.prototype.getGroupInfo=function(e){var t={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+e.groupId,type:"GET",dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};t.success=e.success||_utils2.default.emptyfn,t.error=e.error||_utils2.default.emptyfn,WebIM.utils.ajax(t)},connection.prototype.modifyGroup=function(e){var t=e.groupId,o={groupname:e.groupName,description:e.description},n={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+t,type:"PUT",data:JSON.stringify(o),dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};n.success=e.success||_utils2.default.emptyfn,n.error=e.error||_utils2.default.emptyfn,WebIM.utils.ajax(n)},connection.prototype.listGroupMember=function(e){if(isNaN(e.pageNum)||e.pageNum<=0)throw'The parameter "pageNum" should be a positive number';if(isNaN(e.pageSize)||e.pageSize<=0)throw'The parameter "pageSize" should be a positive number';if(null===e.groupId&&void 0===e.groupId)throw'The parameter "groupId" should be added';var t=[],o=e.groupId;t.pagenum=e.pageNum,t.pagesize=e.pageSize;var n={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+o+"/users",dataType:"json",type:"GET",data:t,headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};n.success=e.success||_utils2.default.emptyfn,n.error=e.error||_utils2.default.emptyfn,WebIM.utils.ajax(n)},connection.prototype.getGroupAdmin=function(e){var t=e.groupId,o={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+t+"/admin",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};o.success=e.success||_utils2.default.emptyfn,o.error=e.error||_utils2.default.emptyfn,WebIM.utils.ajax(o)},connection.prototype.setAdmin=function(e){var t=e.groupId,o={newadmin:e.username},n={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+t+"/admin",type:"POST",dataType:"json",data:JSON.stringify(o),headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};n.success=e.success||_utils2.default.emptyfn,n.error=e.error||_utils2.default.emptyfn,WebIM.utils.ajax(n)},connection.prototype.removeAdmin=function(e){var t=e.groupId,o=e.username,n={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+t+"/admin/"+o,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};n.success=e.success||_utils2.default.emptyfn,n.error=e.error||_utils2.default.emptyfn,WebIM.utils.ajax(n)},connection.prototype.dissolveGroup=function(e){var t=e.groupId,o={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+t+"?version=v3",type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};o.success=e.success||_utils2.default.emptyfn,o.error=e.error||_utils2.default.emptyfn,WebIM.utils.ajax(o)},connection.prototype.quitGroup=function(e){var t=e.groupId,o={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+t+"/quit",type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};o.success=e.success||_utils2.default.emptyfn,o.error=e.error||_utils2.default.emptyfn,WebIM.utils.ajax(o)},connection.prototype.inviteToGroup=function(e){var t=e.groupId,o={usernames:e.users},n={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+t+"/invite",type:"POST",data:JSON.stringify(o),dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};n.success=e.success||_utils2.default.emptyfn,n.error=e.error||_utils2.default.emptyfn,WebIM.utils.ajax(n)},connection.prototype.joinGroup=function(e){var t={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+e.groupId+"/apply",type:"POST",dataType:"json",data:JSON.stringify({message:"join group"}),headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};t.success=e.success||_utils2.default.emptyfn,t.error=e.error||_utils2.default.emptyfn,WebIM.utils.ajax(t)},connection.prototype.agreeJoinGroup=function(e){var t=e.groupId,o={applicant:e.applicant,verifyResult:!0,reason:"no clue"},n={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+t+"/apply_verify",type:"POST",dataType:"json",data:JSON.stringify(o),headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};n.success=e.success||_utils2.default.emptyfn,n.error=e.error||_utils2.default.emptyfn,WebIM.utils.ajax(n)},connection.prototype.rejectJoinGroup=function(e){var t=e.groupId,o={applicant:e.applicant,verifyResult:!1,reason:"no clue"},n={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+t+"/apply_verify",type:"POST",dataType:"json",data:JSON.stringify(o),headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};n.success=e.success||_utils2.default.emptyfn,n.error=e.error||_utils2.default.emptyfn,WebIM.utils.ajax(n)},connection.prototype.agreeInviteIntoGroup=function(e){var t=e.groupId,o={invitee:e.invitee,verifyResult:!0},n={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+t+"/invite_verify",type:"POST",dataType:"json",data:JSON.stringify(o),headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};n.success=e.success||_utils2.default.emptyfn,n.error=e.error||_utils2.default.emptyfn,WebIM.utils.ajax(n)},connection.prototype.rejectInviteIntoGroup=function(e){var t=e.groupId,o={invitee:e.invitee,verifyResult:!1},n={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+t+"/invite_verify",type:"POST",dataType:"json",data:JSON.stringify(o),headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};n.success=e.success||_utils2.default.emptyfn,n.error=e.error||_utils2.default.emptyfn,WebIM.utils.ajax(n)},connection.prototype.removeSingleGroupMember=function(e){var t=e.groupId,o=e.username,n={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+t+"/users/"+o,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};n.success=e.success||_utils2.default.emptyfn,n.error=e.error||_utils2.default.emptyfn,WebIM.utils.ajax(n)},connection.prototype.removeMultiGroupMember=function(e){var t=e.groupId,o=e.users.join(","),n={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+t+"/users/"+o,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};n.success=e.success||_utils2.default.emptyfn,n.error=e.error||_utils2.default.emptyfn,WebIM.utils.ajax(n)},connection.prototype.mute=function(e){var t=e.groupId,o={usernames:[e.username],mute_duration:e.muteDuration},n={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+t+"/mute",dataType:"json",type:"POST",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"},data:JSON.stringify(o)};n.success=e.success||_utils2.default.emptyfn,n.error=e.error||_utils2.default.emptyfn,WebIM.utils.ajax(n)},connection.prototype.removeMute=function(e){var t=e.groupId,o=e.username,n={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+t+"/mute/"+o,dataType:"json",type:"DELETE",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};n.success=e.success||_utils2.default.emptyfn,n.error=e.error||_utils2.default.emptyfn,WebIM.utils.ajax(n)},connection.prototype.getMuted=function(e){var t=e.groupId,o={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+t+"/mute",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};o.success=e.success||_utils2.default.emptyfn,o.error=e.error||_utils2.default.emptyfn,WebIM.utils.ajax(o)},connection.prototype.groupBlockSingle=function(e){var t=e.groupId,o=e.username,n={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+t+"/blocks/users/"+o,type:"POST",dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};n.success=e.success||_utils2.default.emptyfn,n.error=e.error||_utils2.default.emptyfn,WebIM.utils.ajax(n)},connection.prototype.groupBlockMulti=function(e){var t=e.groupId,o={usernames:e.usernames},n={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+t+"/blocks/users",data:JSON.stringify(o),type:"POST",dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};n.success=e.success||_utils2.default.emptyfn,n.error=e.error||_utils2.default.emptyfn,WebIM.utils.ajax(n)},connection.prototype.removeGroupBlockSingle=function(e){var t=e.groupId,o=e.username,n={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+t+"/blocks/users/"+o,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};n.success=e.success||_utils2.default.emptyfn,n.error=e.error||_utils2.default.emptyfn,WebIM.utils.ajax(n)},connection.prototype.removeGroupBlockMulti=function(e){var t=e.groupId,o=e.username.join(","),n={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+t+"/blocks/users/"+o,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};n.success=e.success||_utils2.default.emptyfn,n.error=e.error||_utils2.default.emptyfn,WebIM.utils.ajax(n)},connection.prototype.getGroupBlacklistNew=function(e){var t=e.groupId,o={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+t+"/blocks/users",type:"GET",dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};o.success=e.success||_utils2.default.emptyfn,o.error=e.error||_utils2.default.emptyfn,WebIM.utils.ajax(o)};var WebIM=window.WebIM||{};WebIM.connection=connection,WebIM.utils=_utils2.default,WebIM.statusCode=_code,WebIM.message=_message2.default.message,WebIM.doQuery=function(e,t,o){void 0!==window.cefQuery&&window.cefQuery({request:e,persistent:!1,onSuccess:t,onFailure:o})},WebIM.debug=function(e){},WebIM.version=_version,window.WebIM=WebIM,module.hot&&module.hot.accept();var _default=WebIM;exports.default=_default;
        },{"./allnode":"G7Dp","protobufjs":"fN30","sockjs-client":"EWtC","Base64":"wTgU","./status":"KLYY","./utils":"K0yk","./message":"KTph","./queue":"RCHR","./chat/sendChatMessage":"Aofe","./chat/handleChatMessage":"TvlR","./muc/HandleMucMessage":"wnFo","./roster/HandleRosterMessage":"UOYe","./statistics/HandleStatisticsMessage":"pE/p","long":"YA3p"}],"Focm":[function(require,module,exports) {
            "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=t(require("./src/connection"));function t(e){return e&&e.__esModule?e:{default:e}}var r=e.default;exports.default=r;
        },{"./src/connection":"h12o"}]},{},["Focm"], "WebIM")</script>
    <script >parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcelRequire,u="function"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i="function"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&"string"==typeof t)return u(t);var c=new Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;c<t.length;c++)try{f(t[c])}catch(e){i||(i=e)}if(t.length){var l=f(t[t.length-1]);"object"==typeof exports&&"undefined"!=typeof module?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):n&&(this[n]=l)}if(parcelRequire=f,i)throw i;return f}({"WNWS":[function(require,module,exports) {
            var define;
            var global = arguments[3];
            var define,global=arguments[3];!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["easemob-emedia"]=t():e["easemob-emedia"]=t()}(window,function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/Users/DATA/WORK.HOME/projects/CO./EASEMOB_2016.05.03~/EMedia",n(n.s=13)}([,,function(e,t,n){var r;if(document.documentMode){var i=/\brv[ :]+(\d+)/g.exec(navigator.userAgent)||[],o=parseInt(i[1],10);o||(i=/\bMSIE[ :]+(\d+)/g.exec(navigator.userAgent)||[],o=parseInt(i[1]||"0",10)),logger.error("adapter.ie not required"),r.__browser="IE",r.__browserVersion=o}else r=n(3),function(){function e(e,t){e.srcObject=t}window.attachMediaStream&&!0!==window.attachMediaStream._wrapped&&(window.__attachMediaStream=window.attachMediaStream);window.attachMediaStream=function(t,n,r,i){function o(){r=!!(void 0===r?n._located:r),t.muted=!1,r!==t.muted&&(t.muted=!0)}if(i||(i=window.__attachMediaStream)||(i=e),!t)return;if(!n)return void i(t,n);if(!t.srcObject)return o(),i(t,n),t;if(t.srcObject._located&&n._located&&t.srcObject.id===n.id)return t.srcObject;return o(),i(t,n),t},window.attachMediaStream._wrapped=!0,console&&"function"==typeof console.info&&console.info("Wrap the attachMediaStream ",r.__browser,r.__browserVersion)}();if(r.__browser=r.__browser||r.browserDetails.browser,r.__browserVersion=r.__browserVersion||r.browserDetails.version,console&&"function"==typeof console.info&&console.info("Current browser",r.__browser,r.__browserVersion),"Not a supported browser."===r.__browser)throw"Not a supported browser";e.exports=r},function(e,t){var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};!function(r){if("object"===(void 0===t?"undefined":n(t))&&void 0!==e)e.exports=r();else if("function"==typeof define&&define.amd)define([],r);else{("undefined"!=typeof window?window:void 0!==global?global:"undefined"!=typeof self?self:this).adapter=r()}}(function(){return function e(t,n,r){function i(s,a){if(!n[s]){if(!t[s]){var c="function"==typeof require&&require;if(!a&&c)return c(s,!0);if(o)return o(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var d=n[s]={exports:{}};t[s][0].call(d.exports,function(e){var n=t[s][1][e];return i(n||e)},d,d.exports,e,t,n,r)}return n[s].exports}for(var o="function"==typeof require&&require,s=0;s<r.length;s++)i(r[s]);return i}({1:[function(e,t,n){"use strict";var r=e("sdp");function i(e,t,n,i,o){var s=r.writeRtpDescription(e.kind,t);if(s+=r.writeIceParameters(e.iceGatherer.getLocalParameters()),s+=r.writeDtlsParameters(e.dtlsTransport.getLocalParameters(),"offer"===n?"actpass":o||"active"),s+="a=mid:"+e.mid+"\r\n",e.rtpSender&&e.rtpReceiver?s+="a=sendrecv\r\n":e.rtpSender?s+="a=sendonly\r\n":e.rtpReceiver?s+="a=recvonly\r\n":s+="a=inactive\r\n",e.rtpSender){var a=e.rtpSender._initialTrackId||e.rtpSender.track.id;e.rtpSender._initialTrackId=a;var c="msid:"+(i?i.id:"-")+" "+a+"\r\n";s+="a="+c,s+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" "+c,e.sendEncodingParameters[0].rtx&&(s+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" "+c,s+="a=ssrc-group:FID "+e.sendEncodingParameters[0].ssrc+" "+e.sendEncodingParameters[0].rtx.ssrc+"\r\n")}return s+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" cname:"+r.localCName+"\r\n",e.rtpSender&&e.sendEncodingParameters[0].rtx&&(s+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" cname:"+r.localCName+"\r\n"),s}function o(e,t){var n={codecs:[],headerExtensions:[],fecMechanisms:[]},r=function(e,t){e=parseInt(e,10);for(var n=0;n<t.length;n++)if(t[n].payloadType===e||t[n].preferredPayloadType===e)return t[n]},i=function(e,t,n,i){var o=r(e.parameters.apt,n),s=r(t.parameters.apt,i);return o&&s&&o.name.toLowerCase()===s.name.toLowerCase()};return e.codecs.forEach(function(r){for(var o=0;o<t.codecs.length;o++){var s=t.codecs[o];if(r.name.toLowerCase()===s.name.toLowerCase()&&r.clockRate===s.clockRate){if("rtx"===r.name.toLowerCase()&&r.parameters&&s.parameters.apt&&!i(r,s,e.codecs,t.codecs))continue;(s=JSON.parse(JSON.stringify(s))).numChannels=Math.min(r.numChannels,s.numChannels),n.codecs.push(s),s.rtcpFeedback=s.rtcpFeedback.filter(function(e){for(var t=0;t<r.rtcpFeedback.length;t++)if(r.rtcpFeedback[t].type===e.type&&r.rtcpFeedback[t].parameter===e.parameter)return!0;return!1});break}}}),e.headerExtensions.forEach(function(e){for(var r=0;r<t.headerExtensions.length;r++){var i=t.headerExtensions[r];if(e.uri===i.uri){n.headerExtensions.push(i);break}}}),n}function s(e,t,n){return-1!=={offer:{setLocalDescription:["stable","have-local-offer"],setRemoteDescription:["stable","have-remote-offer"]},answer:{setLocalDescription:["have-remote-offer","have-local-pranswer"],setRemoteDescription:["have-local-offer","have-remote-pranswer"]}}[t][e].indexOf(n)}function a(e,t){var n=e.getRemoteCandidates().find(function(e){return t.foundation===e.foundation&&t.ip===e.ip&&t.port===e.port&&t.priority===e.priority&&t.protocol===e.protocol&&t.type===e.type});return n||e.addRemoteCandidate(t),!n}function c(e,t){var n=new Error(t);return n.name=e,n.code={NotSupportedError:9,InvalidStateError:11,InvalidAccessError:15,TypeError:void 0,OperationError:void 0}[e],n}t.exports=function(e,t){function n(t,n){n.addTrack(t),n.dispatchEvent(new e.MediaStreamTrackEvent("addtrack",{track:t}))}function u(t,n,r,i){var o=new Event("track");o.track=n,o.receiver=r,o.transceiver={receiver:r},o.streams=i,e.setTimeout(function(){t._dispatchEvent("track",o)})}var d=function(n){var i=this,o=document.createDocumentFragment();if(["addEventListener","removeEventListener","dispatchEvent"].forEach(function(e){i[e]=o[e].bind(o)}),this.canTrickleIceCandidates=null,this.needNegotiation=!1,this.localStreams=[],this.remoteStreams=[],this.localDescription=null,this.remoteDescription=null,this.signalingState="stable",this.iceConnectionState="new",this.connectionState="new",this.iceGatheringState="new",n=JSON.parse(JSON.stringify(n||{})),this.usingBundle="max-bundle"===n.bundlePolicy,"negotiate"===n.rtcpMuxPolicy)throw c("NotSupportedError","rtcpMuxPolicy 'negotiate' is not supported");switch(n.rtcpMuxPolicy||(n.rtcpMuxPolicy="require"),n.iceTransportPolicy){case"all":case"relay":break;default:n.iceTransportPolicy="all"}switch(n.bundlePolicy){case"balanced":case"max-compat":case"max-bundle":break;default:n.bundlePolicy="balanced"}if(n.iceServers=function(e,t){var n=!1;return(e=JSON.parse(JSON.stringify(e))).filter(function(e){if(e&&(e.urls||e.url)){var r=e.urls||e.url;e.url&&!e.urls&&console.warn("RTCIceServer.url is deprecated! Use urls instead.");var i="string"==typeof r;return i&&(r=[r]),r=r.filter(function(e){return 0!==e.indexOf("turn:")||-1===e.indexOf("transport=udp")||-1!==e.indexOf("turn:[")||n?0===e.indexOf("stun:")&&t>=14393&&-1===e.indexOf("?transport=udp"):(n=!0,!0)}),delete e.url,e.urls=i?r[0]:r,!!r.length}})}(n.iceServers||[],t),this._iceGatherers=[],n.iceCandidatePoolSize)for(var s=n.iceCandidatePoolSize;s>0;s--)this._iceGatherers.push(new e.RTCIceGatherer({iceServers:n.iceServers,gatherPolicy:n.iceTransportPolicy}));else n.iceCandidatePoolSize=0;this._config=n,this.transceivers=[],this._sdpSessionId=r.generateSessionId(),this._sdpSessionVersion=0,this._dtlsRole=void 0,this._isClosed=!1};d.prototype.onicecandidate=null,d.prototype.onaddstream=null,d.prototype.ontrack=null,d.prototype.onremovestream=null,d.prototype.onsignalingstatechange=null,d.prototype.oniceconnectionstatechange=null,d.prototype.onconnectionstatechange=null,d.prototype.onicegatheringstatechange=null,d.prototype.onnegotiationneeded=null,d.prototype.ondatachannel=null,d.prototype._dispatchEvent=function(e,t){this._isClosed||(this.dispatchEvent(t),"function"==typeof this["on"+e]&&this["on"+e](t))},d.prototype._emitGatheringStateChange=function(){var e=new Event("icegatheringstatechange");this._dispatchEvent("icegatheringstatechange",e)},d.prototype.getConfiguration=function(){return this._config},d.prototype.getLocalStreams=function(){return this.localStreams},d.prototype.getRemoteStreams=function(){return this.remoteStreams},d.prototype._createTransceiver=function(e,t){var n=this.transceivers.length>0,r={track:null,iceGatherer:null,iceTransport:null,dtlsTransport:null,localCapabilities:null,remoteCapabilities:null,rtpSender:null,rtpReceiver:null,kind:e,mid:null,sendEncodingParameters:null,recvEncodingParameters:null,stream:null,associatedRemoteMediaStreams:[],wantReceive:!0};if(this.usingBundle&&n)r.iceTransport=this.transceivers[0].iceTransport,r.dtlsTransport=this.transceivers[0].dtlsTransport;else{var i=this._createIceAndDtlsTransports();r.iceTransport=i.iceTransport,r.dtlsTransport=i.dtlsTransport}return t||this.transceivers.push(r),r},d.prototype.addTrack=function(t,n){if(this._isClosed)throw c("InvalidStateError","Attempted to call addTrack on a closed peerconnection.");var r;if(this.transceivers.find(function(e){return e.track===t}))throw c("InvalidAccessError","Track already exists.");for(var i=0;i<this.transceivers.length;i++)this.transceivers[i].track||this.transceivers[i].kind!==t.kind||(r=this.transceivers[i]);return r||(r=this._createTransceiver(t.kind)),this._maybeFireNegotiationNeeded(),-1===this.localStreams.indexOf(n)&&this.localStreams.push(n),r.track=t,r.stream=n,r.rtpSender=new e.RTCRtpSender(t,r.dtlsTransport),r.rtpSender},d.prototype.addStream=function(e){var n=this;if(t>=15025)e.getTracks().forEach(function(t){n.addTrack(t,e)});else{var r=e.clone();e.getTracks().forEach(function(e,t){var n=r.getTracks()[t];e.addEventListener("enabled",function(e){n.enabled=e.enabled})}),r.getTracks().forEach(function(e){n.addTrack(e,r)})}},d.prototype.removeTrack=function(t){if(this._isClosed)throw c("InvalidStateError","Attempted to call removeTrack on a closed peerconnection.");if(!(t instanceof e.RTCRtpSender))throw new TypeError("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.");var n=this.transceivers.find(function(e){return e.rtpSender===t});if(!n)throw c("InvalidAccessError","Sender was not created by this connection.");var r=n.stream;n.rtpSender.stop(),n.rtpSender=null,n.track=null,n.stream=null,-1===this.transceivers.map(function(e){return e.stream}).indexOf(r)&&this.localStreams.indexOf(r)>-1&&this.localStreams.splice(this.localStreams.indexOf(r),1),this._maybeFireNegotiationNeeded()},d.prototype.removeStream=function(e){var t=this;e.getTracks().forEach(function(e){var n=t.getSenders().find(function(t){return t.track===e});n&&t.removeTrack(n)})},d.prototype.getSenders=function(){return this.transceivers.filter(function(e){return!!e.rtpSender}).map(function(e){return e.rtpSender})},d.prototype.getReceivers=function(){return this.transceivers.filter(function(e){return!!e.rtpReceiver}).map(function(e){return e.rtpReceiver})},d.prototype._createIceGatherer=function(t,n){var r=this;if(n&&t>0)return this.transceivers[0].iceGatherer;if(this._iceGatherers.length)return this._iceGatherers.shift();var i=new e.RTCIceGatherer({iceServers:this._config.iceServers,gatherPolicy:this._config.iceTransportPolicy});return Object.defineProperty(i,"state",{value:"new",writable:!0}),this.transceivers[t].bufferedCandidateEvents=[],this.transceivers[t].bufferCandidates=function(e){var n=!e.candidate||0===Object.keys(e.candidate).length;i.state=n?"completed":"gathering",null!==r.transceivers[t].bufferedCandidateEvents&&r.transceivers[t].bufferedCandidateEvents.push(e)},i.addEventListener("localcandidate",this.transceivers[t].bufferCandidates),i},d.prototype._gather=function(t,n){var i=this,o=this.transceivers[n].iceGatherer;if(!o.onlocalcandidate){var s=this.transceivers[n].bufferedCandidateEvents;this.transceivers[n].bufferedCandidateEvents=null,o.removeEventListener("localcandidate",this.transceivers[n].bufferCandidates),o.onlocalcandidate=function(e){if(!(i.usingBundle&&n>0)){var s=new Event("icecandidate");s.candidate={sdpMid:t,sdpMLineIndex:n};var a=e.candidate,c=!a||0===Object.keys(a).length;if(c)"new"!==o.state&&"gathering"!==o.state||(o.state="completed");else{"new"===o.state&&(o.state="gathering"),a.component=1,a.ufrag=o.getLocalParameters().usernameFragment;var u=r.writeCandidate(a);s.candidate=Object.assign(s.candidate,r.parseCandidate(u)),s.candidate.candidate=u,s.candidate.toJSON=function(){return{candidate:s.candidate.candidate,sdpMid:s.candidate.sdpMid,sdpMLineIndex:s.candidate.sdpMLineIndex,usernameFragment:s.candidate.usernameFragment}}}var d=r.getMediaSections(i.localDescription.sdp);d[s.candidate.sdpMLineIndex]+=c?"a=end-of-candidates\r\n":"a="+s.candidate.candidate+"\r\n",i.localDescription.sdp=r.getDescription(i.localDescription.sdp)+d.join("");var l=i.transceivers.every(function(e){return e.iceGatherer&&"completed"===e.iceGatherer.state});"gathering"!==i.iceGatheringState&&(i.iceGatheringState="gathering",i._emitGatheringStateChange()),c||i._dispatchEvent("icecandidate",s),l&&(i._dispatchEvent("icecandidate",new Event("icecandidate")),i.iceGatheringState="complete",i._emitGatheringStateChange())}},e.setTimeout(function(){s.forEach(function(e){o.onlocalcandidate(e)})},0)}},d.prototype._createIceAndDtlsTransports=function(){var t=this,n=new e.RTCIceTransport(null);n.onicestatechange=function(){t._updateIceConnectionState(),t._updateConnectionState()};var r=new e.RTCDtlsTransport(n);return r.ondtlsstatechange=function(){t._updateConnectionState()},r.onerror=function(){Object.defineProperty(r,"state",{value:"failed",writable:!0}),t._updateConnectionState()},{iceTransport:n,dtlsTransport:r}},d.prototype._disposeIceAndDtlsTransports=function(e){var t=this.transceivers[e].iceGatherer;t&&(delete t.onlocalcandidate,delete this.transceivers[e].iceGatherer);var n=this.transceivers[e].iceTransport;n&&(delete n.onicestatechange,delete this.transceivers[e].iceTransport);var r=this.transceivers[e].dtlsTransport;r&&(delete r.ondtlsstatechange,delete r.onerror,delete this.transceivers[e].dtlsTransport)},d.prototype._transceive=function(e,n,i){var s=o(e.localCapabilities,e.remoteCapabilities);n&&e.rtpSender&&(s.encodings=e.sendEncodingParameters,s.rtcp={cname:r.localCName,compound:e.rtcpParameters.compound},e.recvEncodingParameters.length&&(s.rtcp.ssrc=e.recvEncodingParameters[0].ssrc),e.rtpSender.send(s)),i&&e.rtpReceiver&&s.codecs.length>0&&("video"===e.kind&&e.recvEncodingParameters&&t<15019&&e.recvEncodingParameters.forEach(function(e){delete e.rtx}),e.recvEncodingParameters.length?s.encodings=e.recvEncodingParameters:s.encodings=[{}],s.rtcp={compound:e.rtcpParameters.compound},e.rtcpParameters.cname&&(s.rtcp.cname=e.rtcpParameters.cname),e.sendEncodingParameters.length&&(s.rtcp.ssrc=e.sendEncodingParameters[0].ssrc),e.rtpReceiver.receive(s))},d.prototype.setLocalDescription=function(e){var t,n,i=this;if(-1===["offer","answer"].indexOf(e.type))return Promise.reject(c("TypeError",'Unsupported type "'+e.type+'"'));if(!s("setLocalDescription",e.type,i.signalingState)||i._isClosed)return Promise.reject(c("InvalidStateError","Can not set local "+e.type+" in state "+i.signalingState));if("offer"===e.type)t=r.splitSections(e.sdp),n=t.shift(),t.forEach(function(e,t){var n=r.parseRtpParameters(e);i.transceivers[t].localCapabilities=n}),i.transceivers.forEach(function(e,t){i._gather(e.mid,t)});else if("answer"===e.type){t=r.splitSections(i.remoteDescription.sdp),n=t.shift();var a=r.matchPrefix(n,"a=ice-lite").length>0;t.forEach(function(e,t){var s=i.transceivers[t],c=s.iceGatherer,u=s.iceTransport,d=s.dtlsTransport,l=s.localCapabilities,f=s.remoteCapabilities;if(!(r.isRejected(e)&&0===r.matchPrefix(e,"a=bundle-only").length)&&!s.rejected){var p=r.getIceParameters(e,n),h=r.getDtlsParameters(e,n);a&&(h.role="server"),i.usingBundle&&0!==t||(i._gather(s.mid,t),"new"===u.state&&u.start(c,p,a?"controlling":"controlled"),"new"===d.state&&d.start(h));var m=o(l,f);i._transceive(s,m.codecs.length>0,!1)}})}return i.localDescription={type:e.type,sdp:e.sdp},"offer"===e.type?i._updateSignalingState("have-local-offer"):i._updateSignalingState("stable"),Promise.resolve()},d.prototype.setRemoteDescription=function(i){var o=this;if(-1===["offer","answer"].indexOf(i.type))return Promise.reject(c("TypeError",'Unsupported type "'+i.type+'"'));if(!s("setRemoteDescription",i.type,o.signalingState)||o._isClosed)return Promise.reject(c("InvalidStateError","Can not set remote "+i.type+" in state "+o.signalingState));var d={};o.remoteStreams.forEach(function(e){d[e.id]=e});var l=[],f=r.splitSections(i.sdp),p=f.shift(),h=r.matchPrefix(p,"a=ice-lite").length>0,m=r.matchPrefix(p,"a=group:BUNDLE ").length>0;o.usingBundle=m;var v=r.matchPrefix(p,"a=ice-options:")[0];return o.canTrickleIceCandidates=!!v&&v.substr(14).split(" ").indexOf("trickle")>=0,f.forEach(function(s,c){var u=r.splitLines(s),f=r.getKind(s),v=r.isRejected(s)&&0===r.matchPrefix(s,"a=bundle-only").length,b=u[0].substr(2).split(" ")[2],g=r.getDirection(s,p),_=r.parseMsid(s),y=r.getMid(s)||r.generateIdentifier();if("application"===f&&"DTLS/SCTP"===b||v)o.transceivers[c]={mid:y,kind:f,rejected:!0};else{var S,w,x,C,E,T,I,R,k;!v&&o.transceivers[c]&&o.transceivers[c].rejected&&(o.transceivers[c]=o._createTransceiver(f,!0));var O,M,A=r.parseRtpParameters(s);v||(O=r.getIceParameters(s,p),(M=r.getDtlsParameters(s,p)).role="client"),I=r.parseRtpEncodingParameters(s);var P=r.parseRtcpParameters(s),j=r.matchPrefix(s,"a=end-of-candidates",p).length>0,N=r.matchPrefix(s,"a=candidate:").map(function(e){return r.parseCandidate(e)}).filter(function(e){return 1===e.component});if(("offer"===i.type||"answer"===i.type)&&!v&&m&&c>0&&o.transceivers[c]&&(o._disposeIceAndDtlsTransports(c),o.transceivers[c].iceGatherer=o.transceivers[0].iceGatherer,o.transceivers[c].iceTransport=o.transceivers[0].iceTransport,o.transceivers[c].dtlsTransport=o.transceivers[0].dtlsTransport,o.transceivers[c].rtpSender&&o.transceivers[c].rtpSender.setTransport(o.transceivers[0].dtlsTransport),o.transceivers[c].rtpReceiver&&o.transceivers[c].rtpReceiver.setTransport(o.transceivers[0].dtlsTransport)),"offer"!==i.type||v)"answer"!==i.type||v||(w=(S=o.transceivers[c]).iceGatherer,x=S.iceTransport,C=S.dtlsTransport,E=S.rtpReceiver,T=S.sendEncodingParameters,R=S.localCapabilities,o.transceivers[c].recvEncodingParameters=I,o.transceivers[c].remoteCapabilities=A,o.transceivers[c].rtcpParameters=P,N.length&&"new"===x.state&&(!h&&!j||m&&0!==c?N.forEach(function(e){a(S.iceTransport,e)}):x.setRemoteCandidates(N)),m&&0!==c||("new"===x.state&&x.start(w,O,"controlling"),"new"===C.state&&C.start(M)),o._transceive(S,"sendrecv"===g||"recvonly"===g,"sendrecv"===g||"sendonly"===g),!E||"sendrecv"!==g&&"sendonly"!==g?delete S.rtpReceiver:(k=E.track,_?(d[_.stream]||(d[_.stream]=new e.MediaStream),n(k,d[_.stream]),l.push([k,E,d[_.stream]])):(d.default||(d.default=new e.MediaStream),n(k,d.default),l.push([k,E,d.default]))));else{(S=o.transceivers[c]||o._createTransceiver(f)).mid=y,S.iceGatherer||(S.iceGatherer=o._createIceGatherer(c,m)),N.length&&"new"===S.iceTransport.state&&(!j||m&&0!==c?N.forEach(function(e){a(S.iceTransport,e)}):S.iceTransport.setRemoteCandidates(N)),R=e.RTCRtpReceiver.getCapabilities(f),t<15019&&(R.codecs=R.codecs.filter(function(e){return"rtx"!==e.name})),T=S.sendEncodingParameters||[{ssrc:1001*(2*c+2)}];var D,L=!1;if("sendrecv"===g||"sendonly"===g){if(L=!S.rtpReceiver,E=S.rtpReceiver||new e.RTCRtpReceiver(S.dtlsTransport,f),L)k=E.track,_&&"-"===_.stream||(_?(d[_.stream]||(d[_.stream]=new e.MediaStream,Object.defineProperty(d[_.stream],"id",{get:function(){return _.stream}})),Object.defineProperty(k,"id",{get:function(){return _.track}}),D=d[_.stream]):(d.default||(d.default=new e.MediaStream),D=d.default)),D&&(n(k,D),S.associatedRemoteMediaStreams.push(D)),l.push([k,E,D])}else S.rtpReceiver&&S.rtpReceiver.track&&(S.associatedRemoteMediaStreams.forEach(function(t){var n,r,i=t.getTracks().find(function(e){return e.id===S.rtpReceiver.track.id});i&&(n=i,(r=t).removeTrack(n),r.dispatchEvent(new e.MediaStreamTrackEvent("removetrack",{track:n})))}),S.associatedRemoteMediaStreams=[]);S.localCapabilities=R,S.remoteCapabilities=A,S.rtpReceiver=E,S.rtcpParameters=P,S.sendEncodingParameters=T,S.recvEncodingParameters=I,o._transceive(o.transceivers[c],!1,L)}}}),void 0===o._dtlsRole&&(o._dtlsRole="offer"===i.type?"active":"passive"),o.remoteDescription={type:i.type,sdp:i.sdp},"offer"===i.type?o._updateSignalingState("have-remote-offer"):o._updateSignalingState("stable"),Object.keys(d).forEach(function(t){var n=d[t];if(n.getTracks().length){if(-1===o.remoteStreams.indexOf(n)){o.remoteStreams.push(n);var r=new Event("addstream");r.stream=n,e.setTimeout(function(){o._dispatchEvent("addstream",r)})}l.forEach(function(e){var t=e[0],r=e[1];n.id===e[2].id&&u(o,t,r,[n])})}}),l.forEach(function(e){e[2]||u(o,e[0],e[1],[])}),e.setTimeout(function(){o&&o.transceivers&&o.transceivers.forEach(function(e){e.iceTransport&&"new"===e.iceTransport.state&&e.iceTransport.getRemoteCandidates().length>0&&(console.warn("Timeout for addRemoteCandidate. Consider sending an end-of-candidates notification"),e.iceTransport.addRemoteCandidate({}))})},4e3),Promise.resolve()},d.prototype.close=function(){this.transceivers.forEach(function(e){e.iceTransport&&e.iceTransport.stop(),e.dtlsTransport&&e.dtlsTransport.stop(),e.rtpSender&&e.rtpSender.stop(),e.rtpReceiver&&e.rtpReceiver.stop()}),this._isClosed=!0,this._updateSignalingState("closed")},d.prototype._updateSignalingState=function(e){this.signalingState=e;var t=new Event("signalingstatechange");this._dispatchEvent("signalingstatechange",t)},d.prototype._maybeFireNegotiationNeeded=function(){var t=this;"stable"===this.signalingState&&!0!==this.needNegotiation&&(this.needNegotiation=!0,e.setTimeout(function(){if(t.needNegotiation){t.needNegotiation=!1;var e=new Event("negotiationneeded");t._dispatchEvent("negotiationneeded",e)}},0))},d.prototype._updateIceConnectionState=function(){var e,t={new:0,closed:0,checking:0,connected:0,completed:0,disconnected:0,failed:0};if(this.transceivers.forEach(function(e){t[e.iceTransport.state]++}),e="new",t.failed>0?e="failed":t.checking>0?e="checking":t.disconnected>0?e="disconnected":t.new>0?e="new":t.connected>0?e="connected":t.completed>0&&(e="completed"),e!==this.iceConnectionState){this.iceConnectionState=e;var n=new Event("iceconnectionstatechange");this._dispatchEvent("iceconnectionstatechange",n)}},d.prototype._updateConnectionState=function(){var e,t={new:0,closed:0,connecting:0,connected:0,completed:0,disconnected:0,failed:0};if(this.transceivers.forEach(function(e){t[e.iceTransport.state]++,t[e.dtlsTransport.state]++}),t.connected+=t.completed,e="new",t.failed>0?e="failed":t.connecting>0?e="connecting":t.disconnected>0?e="disconnected":t.new>0?e="new":t.connected>0&&(e="connected"),e!==this.connectionState){this.connectionState=e;var n=new Event("connectionstatechange");this._dispatchEvent("connectionstatechange",n)}},d.prototype.createOffer=function(){var n=this;if(n._isClosed)return Promise.reject(c("InvalidStateError","Can not call createOffer after close"));var o=n.transceivers.filter(function(e){return"audio"===e.kind}).length,s=n.transceivers.filter(function(e){return"video"===e.kind}).length,a=arguments[0];if(a){if(a.mandatory||a.optional)throw new TypeError("Legacy mandatory/optional constraints not supported.");void 0!==a.offerToReceiveAudio&&(o=!0===a.offerToReceiveAudio?1:!1===a.offerToReceiveAudio?0:a.offerToReceiveAudio),void 0!==a.offerToReceiveVideo&&(s=!0===a.offerToReceiveVideo?1:!1===a.offerToReceiveVideo?0:a.offerToReceiveVideo)}for(n.transceivers.forEach(function(e){"audio"===e.kind?--o<0&&(e.wantReceive=!1):"video"===e.kind&&--s<0&&(e.wantReceive=!1)});o>0||s>0;)o>0&&(n._createTransceiver("audio"),o--),s>0&&(n._createTransceiver("video"),s--);var u=r.writeSessionBoilerplate(n._sdpSessionId,n._sdpSessionVersion++);n.transceivers.forEach(function(i,o){var s=i.track,a=i.kind,c=i.mid||r.generateIdentifier();i.mid=c,i.iceGatherer||(i.iceGatherer=n._createIceGatherer(o,n.usingBundle));var u=e.RTCRtpSender.getCapabilities(a);t<15019&&(u.codecs=u.codecs.filter(function(e){return"rtx"!==e.name})),u.codecs.forEach(function(e){"H264"===e.name&&void 0===e.parameters["level-asymmetry-allowed"]&&(e.parameters["level-asymmetry-allowed"]="1"),i.remoteCapabilities&&i.remoteCapabilities.codecs&&i.remoteCapabilities.codecs.forEach(function(t){e.name.toLowerCase()===t.name.toLowerCase()&&e.clockRate===t.clockRate&&(e.preferredPayloadType=t.payloadType)})}),u.headerExtensions.forEach(function(e){(i.remoteCapabilities&&i.remoteCapabilities.headerExtensions||[]).forEach(function(t){e.uri===t.uri&&(e.id=t.id)})});var d=i.sendEncodingParameters||[{ssrc:1001*(2*o+1)}];s&&t>=15019&&"video"===a&&!d[0].rtx&&(d[0].rtx={ssrc:d[0].ssrc+1}),i.wantReceive&&(i.rtpReceiver=new e.RTCRtpReceiver(i.dtlsTransport,a)),i.localCapabilities=u,i.sendEncodingParameters=d}),"max-compat"!==n._config.bundlePolicy&&(u+="a=group:BUNDLE "+n.transceivers.map(function(e){return e.mid}).join(" ")+"\r\n"),u+="a=ice-options:trickle\r\n",n.transceivers.forEach(function(e,t){u+=i(e,e.localCapabilities,"offer",e.stream,n._dtlsRole),u+="a=rtcp-rsize\r\n",!e.iceGatherer||"new"===n.iceGatheringState||0!==t&&n.usingBundle||(e.iceGatherer.getLocalCandidates().forEach(function(e){e.component=1,u+="a="+r.writeCandidate(e)+"\r\n"}),"completed"===e.iceGatherer.state&&(u+="a=end-of-candidates\r\n"))});var d=new e.RTCSessionDescription({type:"offer",sdp:u});return Promise.resolve(d)},d.prototype.createAnswer=function(){var n=this;if(n._isClosed)return Promise.reject(c("InvalidStateError","Can not call createAnswer after close"));if("have-remote-offer"!==n.signalingState&&"have-local-pranswer"!==n.signalingState)return Promise.reject(c("InvalidStateError","Can not call createAnswer in signalingState "+n.signalingState));var s=r.writeSessionBoilerplate(n._sdpSessionId,n._sdpSessionVersion++);n.usingBundle&&(s+="a=group:BUNDLE "+n.transceivers.map(function(e){return e.mid}).join(" ")+"\r\n");var a=r.getMediaSections(n.remoteDescription.sdp).length;n.transceivers.forEach(function(e,r){if(!(r+1>a)){if(e.rejected)return"application"===e.kind?s+="m=application 0 DTLS/SCTP 5000\r\n":"audio"===e.kind?s+="m=audio 0 UDP/TLS/RTP/SAVPF 0\r\na=rtpmap:0 PCMU/8000\r\n":"video"===e.kind&&(s+="m=video 0 UDP/TLS/RTP/SAVPF 120\r\na=rtpmap:120 VP8/90000\r\n"),void(s+="c=IN IP4 0.0.0.0\r\na=inactive\r\na=mid:"+e.mid+"\r\n");var c;if(e.stream)"audio"===e.kind?c=e.stream.getAudioTracks()[0]:"video"===e.kind&&(c=e.stream.getVideoTracks()[0]),c&&t>=15019&&"video"===e.kind&&!e.sendEncodingParameters[0].rtx&&(e.sendEncodingParameters[0].rtx={ssrc:e.sendEncodingParameters[0].ssrc+1});var u=o(e.localCapabilities,e.remoteCapabilities);!u.codecs.filter(function(e){return"rtx"===e.name.toLowerCase()}).length&&e.sendEncodingParameters[0].rtx&&delete e.sendEncodingParameters[0].rtx,s+=i(e,u,"answer",e.stream,n._dtlsRole),e.rtcpParameters&&e.rtcpParameters.reducedSize&&(s+="a=rtcp-rsize\r\n")}});var u=new e.RTCSessionDescription({type:"answer",sdp:s});return Promise.resolve(u)},d.prototype.addIceCandidate=function(e){var t,n=this;return e&&void 0===e.sdpMLineIndex&&!e.sdpMid?Promise.reject(new TypeError("sdpMLineIndex or sdpMid required")):new Promise(function(i,o){if(!n.remoteDescription)return o(c("InvalidStateError","Can not add ICE candidate without a remote description"));if(e&&""!==e.candidate){var s=e.sdpMLineIndex;if(e.sdpMid)for(var u=0;u<n.transceivers.length;u++)if(n.transceivers[u].mid===e.sdpMid){s=u;break}var d=n.transceivers[s];if(!d)return o(c("OperationError","Can not add ICE candidate"));if(d.rejected)return i();var l=Object.keys(e.candidate).length>0?r.parseCandidate(e.candidate):{};if("tcp"===l.protocol&&(0===l.port||9===l.port))return i();if(l.component&&1!==l.component)return i();if((0===s||s>0&&d.iceTransport!==n.transceivers[0].iceTransport)&&!a(d.iceTransport,l))return o(c("OperationError","Can not add ICE candidate"));var f=e.candidate.trim();0===f.indexOf("a=")&&(f=f.substr(2)),(t=r.getMediaSections(n.remoteDescription.sdp))[s]+="a="+(l.type?f:"end-of-candidates")+"\r\n",n.remoteDescription.sdp=r.getDescription(n.remoteDescription.sdp)+t.join("")}else for(var p=0;p<n.transceivers.length&&(n.transceivers[p].rejected||(n.transceivers[p].iceTransport.addRemoteCandidate({}),(t=r.getMediaSections(n.remoteDescription.sdp))[p]+="a=end-of-candidates\r\n",n.remoteDescription.sdp=r.getDescription(n.remoteDescription.sdp)+t.join(""),!n.usingBundle));p++);i()})},d.prototype.getStats=function(t){if(t&&t instanceof e.MediaStreamTrack){var n=null;if(this.transceivers.forEach(function(e){e.rtpSender&&e.rtpSender.track===t?n=e.rtpSender:e.rtpReceiver&&e.rtpReceiver.track===t&&(n=e.rtpReceiver)}),!n)throw c("InvalidAccessError","Invalid selector.");return n.getStats()}var r=[];return this.transceivers.forEach(function(e){["rtpSender","rtpReceiver","iceGatherer","iceTransport","dtlsTransport"].forEach(function(t){e[t]&&r.push(e[t].getStats())})}),Promise.all(r).then(function(e){var t=new Map;return e.forEach(function(e){e.forEach(function(e){t.set(e.id,e)})}),t})};["RTCRtpSender","RTCRtpReceiver","RTCIceGatherer","RTCIceTransport","RTCDtlsTransport"].forEach(function(t){var n=e[t];if(n&&n.prototype&&n.prototype.getStats){var r=n.prototype.getStats;n.prototype.getStats=function(){return r.apply(this).then(function(e){var t=new Map;return Object.keys(e).forEach(function(n){var r;e[n].type={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[(r=e[n]).type]||r.type,t.set(n,e[n])}),t})}}});var l=["createOffer","createAnswer"];return l.forEach(function(e){var t=d.prototype[e];d.prototype[e]=function(){var e=arguments;return"function"==typeof e[0]||"function"==typeof e[1]?t.apply(this,[arguments[2]]).then(function(t){"function"==typeof e[0]&&e[0].apply(null,[t])},function(t){"function"==typeof e[1]&&e[1].apply(null,[t])}):t.apply(this,arguments)}}),(l=["setLocalDescription","setRemoteDescription","addIceCandidate"]).forEach(function(e){var t=d.prototype[e];d.prototype[e]=function(){var e=arguments;return"function"==typeof e[1]||"function"==typeof e[2]?t.apply(this,arguments).then(function(){"function"==typeof e[1]&&e[1].apply(null)},function(t){"function"==typeof e[2]&&e[2].apply(null,[t])}):t.apply(this,arguments)}}),["getStats"].forEach(function(e){var t=d.prototype[e];d.prototype[e]=function(){var e=arguments;return"function"==typeof e[1]?t.apply(this,arguments).then(function(){"function"==typeof e[1]&&e[1].apply(null)}):t.apply(this,arguments)}}),d}},{sdp:2}],2:[function(e,t,r){"use strict";var i={generateIdentifier:function(){return Math.random().toString(36).substr(2,10)}};i.localCName=i.generateIdentifier(),i.splitLines=function(e){return e.trim().split("\n").map(function(e){return e.trim()})},i.splitSections=function(e){return e.split("\nm=").map(function(e,t){return(t>0?"m="+e:e).trim()+"\r\n"})},i.getDescription=function(e){var t=i.splitSections(e);return t&&t[0]},i.getMediaSections=function(e){var t=i.splitSections(e);return t.shift(),t},i.matchPrefix=function(e,t){return i.splitLines(e).filter(function(e){return 0===e.indexOf(t)})},i.parseCandidate=function(e){for(var t,n={foundation:(t=0===e.indexOf("a=candidate:")?e.substring(12).split(" "):e.substring(10).split(" "))[0],component:parseInt(t[1],10),protocol:t[2].toLowerCase(),priority:parseInt(t[3],10),ip:t[4],port:parseInt(t[5],10),type:t[7]},r=8;r<t.length;r+=2)switch(t[r]){case"raddr":n.relatedAddress=t[r+1];break;case"rport":n.relatedPort=parseInt(t[r+1],10);break;case"tcptype":n.tcpType=t[r+1];break;case"ufrag":n.ufrag=t[r+1],n.usernameFragment=t[r+1];break;default:n[t[r]]=t[r+1]}return n},i.writeCandidate=function(e){var t=[];t.push(e.foundation),t.push(e.component),t.push(e.protocol.toUpperCase()),t.push(e.priority),t.push(e.ip),t.push(e.port);var n=e.type;return t.push("typ"),t.push(n),"host"!==n&&e.relatedAddress&&e.relatedPort&&(t.push("raddr"),t.push(e.relatedAddress),t.push("rport"),t.push(e.relatedPort)),e.tcpType&&"tcp"===e.protocol.toLowerCase()&&(t.push("tcptype"),t.push(e.tcpType)),(e.usernameFragment||e.ufrag)&&(t.push("ufrag"),t.push(e.usernameFragment||e.ufrag)),"candidate:"+t.join(" ")},i.parseIceOptions=function(e){return e.substr(14).split(" ")},i.parseRtpMap=function(e){var t=e.substr(9).split(" "),n={payloadType:parseInt(t.shift(),10)};return t=t[0].split("/"),n.name=t[0],n.clockRate=parseInt(t[1],10),n.channels=3===t.length?parseInt(t[2],10):1,n.numChannels=n.channels,n},i.writeRtpMap=function(e){var t=e.payloadType;void 0!==e.preferredPayloadType&&(t=e.preferredPayloadType);var n=e.channels||e.numChannels||1;return"a=rtpmap:"+t+" "+e.name+"/"+e.clockRate+(1!==n?"/"+n:"")+"\r\n"},i.parseExtmap=function(e){var t=e.substr(9).split(" ");return{id:parseInt(t[0],10),direction:t[0].indexOf("/")>0?t[0].split("/")[1]:"sendrecv",uri:t[1]}},i.writeExtmap=function(e){return"a=extmap:"+(e.id||e.preferredId)+(e.direction&&"sendrecv"!==e.direction?"/"+e.direction:"")+" "+e.uri+"\r\n"},i.parseFmtp=function(e){for(var t,n={},r=e.substr(e.indexOf(" ")+1).split(";"),i=0;i<r.length;i++)n[(t=r[i].trim().split("="))[0].trim()]=t[1];return n},i.writeFmtp=function(e){var t="",n=e.payloadType;if(void 0!==e.preferredPayloadType&&(n=e.preferredPayloadType),e.parameters&&Object.keys(e.parameters).length){var r=[];Object.keys(e.parameters).forEach(function(t){e.parameters[t]?r.push(t+"="+e.parameters[t]):r.push(t)}),t+="a=fmtp:"+n+" "+r.join(";")+"\r\n"}return t},i.parseRtcpFb=function(e){var t=e.substr(e.indexOf(" ")+1).split(" ");return{type:t.shift(),parameter:t.join(" ")}},i.writeRtcpFb=function(e){var t="",n=e.payloadType;return void 0!==e.preferredPayloadType&&(n=e.preferredPayloadType),e.rtcpFeedback&&e.rtcpFeedback.length&&e.rtcpFeedback.forEach(function(e){t+="a=rtcp-fb:"+n+" "+e.type+(e.parameter&&e.parameter.length?" "+e.parameter:"")+"\r\n"}),t},i.parseSsrcMedia=function(e){var t=e.indexOf(" "),n={ssrc:parseInt(e.substr(7,t-7),10)},r=e.indexOf(":",t);return r>-1?(n.attribute=e.substr(t+1,r-t-1),n.value=e.substr(r+1)):n.attribute=e.substr(t+1),n},i.getMid=function(e){var t=i.matchPrefix(e,"a=mid:")[0];if(t)return t.substr(6)},i.parseFingerprint=function(e){var t=e.substr(14).split(" ");return{algorithm:t[0].toLowerCase(),value:t[1]}},i.getDtlsParameters=function(e,t){return{role:"auto",fingerprints:i.matchPrefix(e+t,"a=fingerprint:").map(i.parseFingerprint)}},i.writeDtlsParameters=function(e,t){var n="a=setup:"+t+"\r\n";return e.fingerprints.forEach(function(e){n+="a=fingerprint:"+e.algorithm+" "+e.value+"\r\n"}),n},i.getIceParameters=function(e,t){var n=i.splitLines(e);return{usernameFragment:(n=n.concat(i.splitLines(t))).filter(function(e){return 0===e.indexOf("a=ice-ufrag:")})[0].substr(12),password:n.filter(function(e){return 0===e.indexOf("a=ice-pwd:")})[0].substr(10)}},i.writeIceParameters=function(e){return"a=ice-ufrag:"+e.usernameFragment+"\r\na=ice-pwd:"+e.password+"\r\n"},i.parseRtpParameters=function(e){for(var t={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},n=i.splitLines(e)[0].split(" "),r=3;r<n.length;r++){var o=n[r],s=i.matchPrefix(e,"a=rtpmap:"+o+" ")[0];if(s){var a=i.parseRtpMap(s),c=i.matchPrefix(e,"a=fmtp:"+o+" ");switch(a.parameters=c.length?i.parseFmtp(c[0]):{},a.rtcpFeedback=i.matchPrefix(e,"a=rtcp-fb:"+o+" ").map(i.parseRtcpFb),t.codecs.push(a),a.name.toUpperCase()){case"RED":case"ULPFEC":t.fecMechanisms.push(a.name.toUpperCase())}}}return i.matchPrefix(e,"a=extmap:").forEach(function(e){t.headerExtensions.push(i.parseExtmap(e))}),t},i.writeRtpDescription=function(e,t){var n="";n+="m="+e+" ",n+=t.codecs.length>0?"9":"0",n+=" UDP/TLS/RTP/SAVPF ",n+=t.codecs.map(function(e){return void 0!==e.preferredPayloadType?e.preferredPayloadType:e.payloadType}).join(" ")+"\r\n",n+="c=IN IP4 0.0.0.0\r\n",n+="a=rtcp:9 IN IP4 0.0.0.0\r\n",t.codecs.forEach(function(e){n+=i.writeRtpMap(e),n+=i.writeFmtp(e),n+=i.writeRtcpFb(e)});var r=0;return t.codecs.forEach(function(e){e.maxptime>r&&(r=e.maxptime)}),r>0&&(n+="a=maxptime:"+r+"\r\n"),n+="a=rtcp-mux\r\n",t.headerExtensions&&t.headerExtensions.forEach(function(e){n+=i.writeExtmap(e)}),n},i.parseRtpEncodingParameters=function(e){var t,n=[],r=i.parseRtpParameters(e),o=-1!==r.fecMechanisms.indexOf("RED"),s=-1!==r.fecMechanisms.indexOf("ULPFEC"),a=i.matchPrefix(e,"a=ssrc:").map(function(e){return i.parseSsrcMedia(e)}).filter(function(e){return"cname"===e.attribute}),c=a.length>0&&a[0].ssrc,u=i.matchPrefix(e,"a=ssrc-group:FID").map(function(e){return e.substr(17).split(" ").map(function(e){return parseInt(e,10)})});u.length>0&&u[0].length>1&&u[0][0]===c&&(t=u[0][1]),r.codecs.forEach(function(e){if("RTX"===e.name.toUpperCase()&&e.parameters.apt){var r={ssrc:c,codecPayloadType:parseInt(e.parameters.apt,10)};c&&t&&(r.rtx={ssrc:t}),n.push(r),o&&((r=JSON.parse(JSON.stringify(r))).fec={ssrc:t,mechanism:s?"red+ulpfec":"red"},n.push(r))}}),0===n.length&&c&&n.push({ssrc:c});var d=i.matchPrefix(e,"b=");return d.length&&(d=0===d[0].indexOf("b=TIAS:")?parseInt(d[0].substr(7),10):0===d[0].indexOf("b=AS:")?1e3*parseInt(d[0].substr(5),10)*.95-16e3:void 0,n.forEach(function(e){e.maxBitrate=d})),n},i.parseRtcpParameters=function(e){var t={},n=i.matchPrefix(e,"a=ssrc:").map(function(e){return i.parseSsrcMedia(e)}).filter(function(e){return"cname"===e.attribute})[0];n&&(t.cname=n.value,t.ssrc=n.ssrc);var r=i.matchPrefix(e,"a=rtcp-rsize");t.reducedSize=r.length>0,t.compound=0===r.length;var o=i.matchPrefix(e,"a=rtcp-mux");return t.mux=o.length>0,t},i.parseMsid=function(e){var t,n=i.matchPrefix(e,"a=msid:");if(1===n.length)return{stream:(t=n[0].substr(7).split(" "))[0],track:t[1]};var r=i.matchPrefix(e,"a=ssrc:").map(function(e){return i.parseSsrcMedia(e)}).filter(function(e){return"msid"===e.attribute});return r.length>0?{stream:(t=r[0].value.split(" "))[0],track:t[1]}:void 0},i.generateSessionId=function(){return Math.random().toString().substr(2,21)},i.writeSessionBoilerplate=function(e,t){var n=void 0!==t?t:2;return"v=0\r\no=thisisadapterortc "+(e||i.generateSessionId())+" "+n+" IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"},i.writeMediaSection=function(e,t,n,r){var o=i.writeRtpDescription(e.kind,t);if(o+=i.writeIceParameters(e.iceGatherer.getLocalParameters()),o+=i.writeDtlsParameters(e.dtlsTransport.getLocalParameters(),"offer"===n?"actpass":"active"),o+="a=mid:"+e.mid+"\r\n",e.direction?o+="a="+e.direction+"\r\n":e.rtpSender&&e.rtpReceiver?o+="a=sendrecv\r\n":e.rtpSender?o+="a=sendonly\r\n":e.rtpReceiver?o+="a=recvonly\r\n":o+="a=inactive\r\n",e.rtpSender){var s="msid:"+r.id+" "+e.rtpSender.track.id+"\r\n";o+="a="+s,o+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" "+s,e.sendEncodingParameters[0].rtx&&(o+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" "+s,o+="a=ssrc-group:FID "+e.sendEncodingParameters[0].ssrc+" "+e.sendEncodingParameters[0].rtx.ssrc+"\r\n")}return o+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" cname:"+i.localCName+"\r\n",e.rtpSender&&e.sendEncodingParameters[0].rtx&&(o+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" cname:"+i.localCName+"\r\n"),o},i.getDirection=function(e,t){for(var n=i.splitLines(e),r=0;r<n.length;r++)switch(n[r]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return n[r].substr(2)}return t?i.getDirection(t):"sendrecv"},i.getKind=function(e){return i.splitLines(e)[0].split(" ")[0].substr(2)},i.isRejected=function(e){return"0"===e.split(" ",2)[1]},i.parseMLine=function(e){var t=i.splitLines(e)[0].substr(2).split(" ");return{kind:t[0],port:parseInt(t[1],10),protocol:t[2],fmt:t.slice(3).join(" ")}},i.parseOLine=function(e){var t=i.matchPrefix(e,"o=")[0].substr(2).split(" ");return{username:t[0],sessionId:t[1],sessionVersion:parseInt(t[2],10),netType:t[3],addressType:t[4],address:t[5]}},"object"===(void 0===t?"undefined":n(t))&&(t.exports=i)},{}],3:[function(e,t,n){(function(n){"use strict";var r=e("./adapter_factory.js");t.exports=r({window:n.window})}).call(this,void 0!==global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./adapter_factory.js":4}],4:[function(e,t,n){"use strict";var r=e("./utils");t.exports=function(t,n){var i=t&&t.window,o={shimChrome:!0,shimFirefox:!0,shimEdge:!0,shimSafari:!0};for(var s in n)hasOwnProperty.call(n,s)&&(o[s]=n[s]);var a=r.log,c=r.detectBrowser(i),u=e("./chrome/chrome_shim")||null,d=e("./edge/edge_shim")||null,l=e("./firefox/firefox_shim")||null,f=e("./safari/safari_shim")||null,p=e("./common_shim")||null,h={browserDetails:c,commonShim:p,extractVersion:r.extractVersion,disableLog:r.disableLog,disableWarnings:r.disableWarnings};switch(c.browser){case"chrome":if(!u||!u.shimPeerConnection||!o.shimChrome)return a("Chrome shim is not included in this adapter release."),h;a("adapter.js shimming chrome."),h.browserShim=u,p.shimCreateObjectURL(i),u.shimGetUserMedia(i),u.shimMediaStream(i),u.shimSourceObject(i),u.shimPeerConnection(i),u.shimOnTrack(i),u.shimAddTrackRemoveTrack(i),u.shimGetSendersWithDtmf(i),u.shimSenderReceiverGetStats(i),p.shimRTCIceCandidate(i),p.shimMaxMessageSize(i),p.shimSendThrowTypeError(i);break;case"firefox":if(!l||!l.shimPeerConnection||!o.shimFirefox)return a("Firefox shim is not included in this adapter release."),h;a("adapter.js shimming firefox."),h.browserShim=l,p.shimCreateObjectURL(i),l.shimGetUserMedia(i),l.shimSourceObject(i),l.shimPeerConnection(i),l.shimOnTrack(i),l.shimRemoveStream(i),l.shimSenderGetStats(i),l.shimReceiverGetStats(i),l.shimRTCDataChannel(i),p.shimRTCIceCandidate(i),p.shimMaxMessageSize(i),p.shimSendThrowTypeError(i);break;case"edge":if(!d||!d.shimPeerConnection||!o.shimEdge)return a("MS edge shim is not included in this adapter release."),h;a("adapter.js shimming edge."),h.browserShim=d,p.shimCreateObjectURL(i),d.shimGetUserMedia(i),d.shimPeerConnection(i),d.shimReplaceTrack(i),p.shimMaxMessageSize(i),p.shimSendThrowTypeError(i);break;case"safari":if(!f||!o.shimSafari)return a("Safari shim is not included in this adapter release."),h;a("adapter.js shimming safari."),h.browserShim=f,p.shimCreateObjectURL(i),f.shimRTCIceServerUrls(i),f.shimCallbacksAPI(i),f.shimLocalStreamsAPI(i),f.shimRemoteStreamsAPI(i),f.shimTrackEventTransceiver(i),f.shimGetUserMedia(i),f.shimCreateOfferLegacy(i),p.shimRTCIceCandidate(i),p.shimMaxMessageSize(i),p.shimSendThrowTypeError(i);break;default:a("Unsupported browser!")}return h}},{"./chrome/chrome_shim":5,"./common_shim":7,"./edge/edge_shim":8,"./firefox/firefox_shim":11,"./safari/safari_shim":13,"./utils":14}],5:[function(e,t,r){"use strict";var i=e("../utils.js"),o=i.log;function s(e,t,n){var r=n?"outbound-rtp":"inbound-rtp",i=new Map;if(null===t)return i;var o=[];return e.forEach(function(e){"track"===e.type&&e.trackIdentifier===t.id&&o.push(e)}),o.forEach(function(t){e.forEach(function(n){n.type===r&&n.trackId===t.id&&function e(t,n,r){n&&!r.has(n.id)&&(r.set(n.id,n),Object.keys(n).forEach(function(i){i.endsWith("Id")?e(t,t.get(n[i]),r):i.endsWith("Ids")&&n[i].forEach(function(n){e(t,t.get(n),r)})}))}(e,n,i)})}),i}t.exports={shimGetUserMedia:e("./getusermedia"),shimMediaStream:function(e){e.MediaStream=e.MediaStream||e.webkitMediaStream},shimOnTrack:function(e){if("object"!==(void 0===e?"undefined":n(e))||!e.RTCPeerConnection||"ontrack"in e.RTCPeerConnection.prototype)"RTCRtpTransceiver"in e||i.wrapPeerConnectionEvent(e,"track",function(e){return e.transceiver||(e.transceiver={receiver:e.receiver}),e});else{Object.defineProperty(e.RTCPeerConnection.prototype,"ontrack",{get:function(){return this._ontrack},set:function(e){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=e)}});var t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){var n=this;return n._ontrackpoly||(n._ontrackpoly=function(t){t.stream.addEventListener("addtrack",function(r){var i;i=e.RTCPeerConnection.prototype.getReceivers?n.getReceivers().find(function(e){return e.track&&e.track.id===r.track.id}):{track:r.track};var o=new Event("track");o.track=r.track,o.receiver=i,o.transceiver={receiver:i},o.streams=[t.stream],n.dispatchEvent(o)}),t.stream.getTracks().forEach(function(r){var i;i=e.RTCPeerConnection.prototype.getReceivers?n.getReceivers().find(function(e){return e.track&&e.track.id===r.id}):{track:r};var o=new Event("track");o.track=r,o.receiver=i,o.transceiver={receiver:i},o.streams=[t.stream],n.dispatchEvent(o)})},n.addEventListener("addstream",n._ontrackpoly)),t.apply(n,arguments)}}},shimGetSendersWithDtmf:function(e){if("object"===(void 0===e?"undefined":n(e))&&e.RTCPeerConnection&&!("getSenders"in e.RTCPeerConnection.prototype)&&"createDTMFSender"in e.RTCPeerConnection.prototype){var t=function(e,t){return{track:t,get dtmf(){return void 0===this._dtmf&&("audio"===t.kind?this._dtmf=e.createDTMFSender(t):this._dtmf=null),this._dtmf},_pc:e}};if(!e.RTCPeerConnection.prototype.getSenders){e.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};var r=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,n){var i=r.apply(this,arguments);return i||(i=t(this,e),this._senders.push(i)),i};var i=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){i.apply(this,arguments);var t=this._senders.indexOf(e);-1!==t&&this._senders.splice(t,1)}}var o=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){var n=this;n._senders=n._senders||[],o.apply(n,[e]),e.getTracks().forEach(function(e){n._senders.push(t(n,e))})};var s=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){var t=this;t._senders=t._senders||[],s.apply(t,[e]),e.getTracks().forEach(function(e){var n=t._senders.find(function(t){return t.track===e});n&&t._senders.splice(t._senders.indexOf(n),1)})}}else if("object"===(void 0===e?"undefined":n(e))&&e.RTCPeerConnection&&"getSenders"in e.RTCPeerConnection.prototype&&"createDTMFSender"in e.RTCPeerConnection.prototype&&e.RTCRtpSender&&!("dtmf"in e.RTCRtpSender.prototype)){var a=e.RTCPeerConnection.prototype.getSenders;e.RTCPeerConnection.prototype.getSenders=function(){var e=this,t=a.apply(e,[]);return t.forEach(function(t){t._pc=e}),t},Object.defineProperty(e.RTCRtpSender.prototype,"dtmf",{get:function(){return void 0===this._dtmf&&("audio"===this.track.kind?this._dtmf=this._pc.createDTMFSender(this.track):this._dtmf=null),this._dtmf}})}},shimSenderReceiverGetStats:function(e){if("object"===(void 0===e?"undefined":n(e))&&e.RTCPeerConnection&&e.RTCRtpSender&&e.RTCRtpReceiver){if(!("getStats"in e.RTCRtpSender.prototype)){var t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){var e=this,n=t.apply(e,[]);return n.forEach(function(t){t._pc=e}),n});var r=e.RTCPeerConnection.prototype.addTrack;r&&(e.RTCPeerConnection.prototype.addTrack=function(){var e=r.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){var e=this;return this._pc.getStats().then(function(t){return s(t,e.track,!0)})}}if(!("getStats"in e.RTCRtpReceiver.prototype)){var o=e.RTCPeerConnection.prototype.getReceivers;o&&(e.RTCPeerConnection.prototype.getReceivers=function(){var e=this,t=o.apply(e,[]);return t.forEach(function(t){t._pc=e}),t}),i.wrapPeerConnectionEvent(e,"track",function(e){return e.receiver._pc=e.srcElement,e}),e.RTCRtpReceiver.prototype.getStats=function(){var e=this;return this._pc.getStats().then(function(t){return s(t,e.track,!1)})}}if("getStats"in e.RTCRtpSender.prototype&&"getStats"in e.RTCRtpReceiver.prototype){var a=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof e.MediaStreamTrack){var t,n,r,i=arguments[0];return this.getSenders().forEach(function(e){e.track===i&&(t?r=!0:t=e)}),this.getReceivers().forEach(function(e){return e.track===i&&(n?r=!0:n=e),e.track===i}),r||t&&n?Promise.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):t?t.getStats():n?n.getStats():Promise.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return a.apply(this,arguments)}}}},shimSourceObject:function(e){var t=e&&e.URL;"object"===(void 0===e?"undefined":n(e))&&(!e.HTMLMediaElement||"srcObject"in e.HTMLMediaElement.prototype||Object.defineProperty(e.HTMLMediaElement.prototype,"srcObject",{get:function(){return this._srcObject},set:function(e){var n=this;this._srcObject=e,this.src&&t.revokeObjectURL(this.src),e?(this.src=t.createObjectURL(e),e.addEventListener("addtrack",function(){n.src&&t.revokeObjectURL(n.src),n.src=t.createObjectURL(e)}),e.addEventListener("removetrack",function(){n.src&&t.revokeObjectURL(n.src),n.src=t.createObjectURL(e)})):this.src=""}}))},shimAddTrackRemoveTrackWithNative:function(e){e.RTCPeerConnection.prototype.getLocalStreams=function(){var e=this;return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map(function(t){return e._shimmedLocalStreams[t][0]})};var t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,n){if(!n)return t.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};var r=t.apply(this,arguments);return this._shimmedLocalStreams[n.id]?-1===this._shimmedLocalStreams[n.id].indexOf(r)&&this._shimmedLocalStreams[n.id].push(r):this._shimmedLocalStreams[n.id]=[n,r],r};var n=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){var t=this;this._shimmedLocalStreams=this._shimmedLocalStreams||{},e.getTracks().forEach(function(e){if(t.getSenders().find(function(t){return t.track===e}))throw new DOMException("Track already exists.","InvalidAccessError")});var r=t.getSenders();n.apply(this,arguments);var i=t.getSenders().filter(function(e){return-1===r.indexOf(e)});this._shimmedLocalStreams[e.id]=[e].concat(i)};var r=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[e.id],r.apply(this,arguments)};var i=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){var t=this;return this._shimmedLocalStreams=this._shimmedLocalStreams||{},e&&Object.keys(this._shimmedLocalStreams).forEach(function(n){var r=t._shimmedLocalStreams[n].indexOf(e);-1!==r&&t._shimmedLocalStreams[n].splice(r,1),1===t._shimmedLocalStreams[n].length&&delete t._shimmedLocalStreams[n]}),i.apply(this,arguments)}},shimAddTrackRemoveTrack:function(e){var t=i.detectBrowser(e);if(e.RTCPeerConnection.prototype.addTrack&&t.version>=65)return this.shimAddTrackRemoveTrackWithNative(e);var n=e.RTCPeerConnection.prototype.getLocalStreams;e.RTCPeerConnection.prototype.getLocalStreams=function(){var e=this,t=n.apply(this);return e._reverseStreams=e._reverseStreams||{},t.map(function(t){return e._reverseStreams[t.id]})};var r=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(t){var n=this;if(n._streams=n._streams||{},n._reverseStreams=n._reverseStreams||{},t.getTracks().forEach(function(e){if(n.getSenders().find(function(t){return t.track===e}))throw new DOMException("Track already exists.","InvalidAccessError")}),!n._reverseStreams[t.id]){var i=new e.MediaStream(t.getTracks());n._streams[t.id]=i,n._reverseStreams[i.id]=t,t=i}r.apply(n,[t])};var o=e.RTCPeerConnection.prototype.removeStream;function s(e,t){var n=t.sdp;return Object.keys(e._reverseStreams||[]).forEach(function(t){var r=e._reverseStreams[t],i=e._streams[r.id];n=n.replace(new RegExp(i.id,"g"),r.id)}),new RTCSessionDescription({type:t.type,sdp:n})}e.RTCPeerConnection.prototype.removeStream=function(e){var t=this;t._streams=t._streams||{},t._reverseStreams=t._reverseStreams||{},o.apply(t,[t._streams[e.id]||e]),delete t._reverseStreams[t._streams[e.id]?t._streams[e.id].id:e.id],delete t._streams[e.id]},e.RTCPeerConnection.prototype.addTrack=function(t,n){var r=this;if("closed"===r.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");var i=[].slice.call(arguments,1);if(1!==i.length||!i[0].getTracks().find(function(e){return e===t}))throw new DOMException("The adapter.js addTrack polyfill only supports a single  stream which is associated with the specified track.","NotSupportedError");if(r.getSenders().find(function(e){return e.track===t}))throw new DOMException("Track already exists.","InvalidAccessError");r._streams=r._streams||{},r._reverseStreams=r._reverseStreams||{};var o=r._streams[n.id];if(o)o.addTrack(t),Promise.resolve().then(function(){r.dispatchEvent(new Event("negotiationneeded"))});else{var s=new e.MediaStream([t]);r._streams[n.id]=s,r._reverseStreams[s.id]=n,r.addStream(s)}return r.getSenders().find(function(e){return e.track===t})},["createOffer","createAnswer"].forEach(function(t){var n=e.RTCPeerConnection.prototype[t];e.RTCPeerConnection.prototype[t]=function(){var e=this,t=arguments;return arguments.length&&"function"==typeof arguments[0]?n.apply(e,[function(n){var r=s(e,n);t[0].apply(null,[r])},function(e){t[1]&&t[1].apply(null,e)},arguments[2]]):n.apply(e,arguments).then(function(t){return s(e,t)})}});var a=e.RTCPeerConnection.prototype.setLocalDescription;e.RTCPeerConnection.prototype.setLocalDescription=function(){return arguments.length&&arguments[0].type?(arguments[0]=function(e,t){var n=t.sdp;return Object.keys(e._reverseStreams||[]).forEach(function(t){var r=e._reverseStreams[t],i=e._streams[r.id];n=n.replace(new RegExp(r.id,"g"),i.id)}),new RTCSessionDescription({type:t.type,sdp:n})}(this,arguments[0]),a.apply(this,arguments)):a.apply(this,arguments)};var c=Object.getOwnPropertyDescriptor(e.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(e.RTCPeerConnection.prototype,"localDescription",{get:function(){var e=c.get.apply(this);return""===e.type?e:s(this,e)}}),e.RTCPeerConnection.prototype.removeTrack=function(e){var t,n=this;if("closed"===n.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!e._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");if(!(e._pc===n))throw new DOMException("Sender was not created by this connection.","InvalidAccessError");n._streams=n._streams||{},Object.keys(n._streams).forEach(function(r){n._streams[r].getTracks().find(function(t){return e.track===t})&&(t=n._streams[r])}),t&&(1===t.getTracks().length?n.removeStream(n._reverseStreams[t.id]):t.removeTrack(e.track),n.dispatchEvent(new Event("negotiationneeded")))}},shimPeerConnection:function(e){var t=i.detectBrowser(e);if(!e.RTCPeerConnection&&e.webkitRTCPeerConnection)e.RTCPeerConnection=function(t,n){return o("PeerConnection"),t&&t.iceTransportPolicy&&(t.iceTransports=t.iceTransportPolicy),new e.webkitRTCPeerConnection(t,n)},e.RTCPeerConnection.prototype=e.webkitRTCPeerConnection.prototype,e.webkitRTCPeerConnection.generateCertificate&&Object.defineProperty(e.RTCPeerConnection,"generateCertificate",{get:function(){return e.webkitRTCPeerConnection.generateCertificate}});else{var r=e.RTCPeerConnection;e.RTCPeerConnection=function(e,t){if(e&&e.iceServers){for(var n=[],o=0;o<e.iceServers.length;o++){var s=e.iceServers[o];!s.hasOwnProperty("urls")&&s.hasOwnProperty("url")?(i.deprecated("RTCIceServer.url","RTCIceServer.urls"),(s=JSON.parse(JSON.stringify(s))).urls=s.url,n.push(s)):n.push(e.iceServers[o])}e.iceServers=n}return new r(e,t)},e.RTCPeerConnection.prototype=r.prototype,Object.defineProperty(e.RTCPeerConnection,"generateCertificate",{get:function(){return r.generateCertificate}})}var s=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(e,t,n){var r=this,i=arguments;if(arguments.length>0&&"function"==typeof e)return s.apply(this,arguments);if(0===s.length&&(0===arguments.length||"function"!=typeof arguments[0]))return s.apply(this,[]);var o=function(e){var t={};return e.result().forEach(function(e){var n={id:e.id,timestamp:e.timestamp,type:{localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[e.type]||e.type};e.names().forEach(function(t){n[t]=e.stat(t)}),t[n.id]=n}),t},a=function(e){return new Map(Object.keys(e).map(function(t){return[t,e[t]]}))};if(arguments.length>=2){return s.apply(this,[function(e){i[1](a(o(e)))},arguments[0]])}return new Promise(function(e,t){s.apply(r,[function(t){e(a(o(t)))},t])}).then(t,n)},t.version<51&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(t){var n=e.RTCPeerConnection.prototype[t];e.RTCPeerConnection.prototype[t]=function(){var e=arguments,t=this,r=new Promise(function(r,i){n.apply(t,[e[0],r,i])});return e.length<2?r:r.then(function(){e[1].apply(null,[])},function(t){e.length>=3&&e[2].apply(null,[t])})}}),t.version<52&&["createOffer","createAnswer"].forEach(function(t){var r=e.RTCPeerConnection.prototype[t];e.RTCPeerConnection.prototype[t]=function(){var e=this;if(arguments.length<1||1===arguments.length&&"object"===n(arguments[0])){var t=1===arguments.length?arguments[0]:void 0;return new Promise(function(n,i){r.apply(e,[n,i,t])})}return r.apply(this,arguments)}}),["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(t){var n=e.RTCPeerConnection.prototype[t];e.RTCPeerConnection.prototype[t]=function(){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}});var a=e.RTCPeerConnection.prototype.addIceCandidate;e.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?a.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())}}}},{"../utils.js":14,"./getusermedia":6}],6:[function(e,t,r){"use strict";var i=e("../utils.js"),o=i.log;t.exports=function(e){var t=i.detectBrowser(e),r=e&&e.navigator,s=function(e){if("object"!==(void 0===e?"undefined":n(e))||e.mandatory||e.optional)return e;var t={};return Object.keys(e).forEach(function(r){if("require"!==r&&"advanced"!==r&&"mediaSource"!==r){var i="object"===n(e[r])?e[r]:{ideal:e[r]};void 0!==i.exact&&"number"==typeof i.exact&&(i.min=i.max=i.exact);var o=function(e,t){return e?e+t.charAt(0).toUpperCase()+t.slice(1):"deviceId"===t?"sourceId":t};if(void 0!==i.ideal){t.optional=t.optional||[];var s={};"number"==typeof i.ideal?(s[o("min",r)]=i.ideal,t.optional.push(s),(s={})[o("max",r)]=i.ideal,t.optional.push(s)):(s[o("",r)]=i.ideal,t.optional.push(s))}void 0!==i.exact&&"number"!=typeof i.exact?(t.mandatory=t.mandatory||{},t.mandatory[o("",r)]=i.exact):["min","max"].forEach(function(e){void 0!==i[e]&&(t.mandatory=t.mandatory||{},t.mandatory[o(e,r)]=i[e])})}}),e.advanced&&(t.optional=(t.optional||[]).concat(e.advanced)),t},a=function(e,i){if(t.version>=61)return i(e);if((e=JSON.parse(JSON.stringify(e)))&&"object"===n(e.audio)){var a=function(e,t,n){t in e&&!(n in e)&&(e[n]=e[t],delete e[t])};a((e=JSON.parse(JSON.stringify(e))).audio,"autoGainControl","googAutoGainControl"),a(e.audio,"noiseSuppression","googNoiseSuppression"),e.audio=s(e.audio)}if(e&&"object"===n(e.video)){var c=e.video.facingMode;c=c&&("object"===(void 0===c?"undefined":n(c))?c:{ideal:c});var u,d=t.version<66;if(c&&("user"===c.exact||"environment"===c.exact||"user"===c.ideal||"environment"===c.ideal)&&(!r.mediaDevices.getSupportedConstraints||!r.mediaDevices.getSupportedConstraints().facingMode||d))if(delete e.video.facingMode,"environment"===c.exact||"environment"===c.ideal?u=["back","rear"]:"user"!==c.exact&&"user"!==c.ideal||(u=["front"]),u)return r.mediaDevices.enumerateDevices().then(function(t){var n=(t=t.filter(function(e){return"videoinput"===e.kind})).find(function(e){return u.some(function(t){return-1!==e.label.toLowerCase().indexOf(t)})});return!n&&t.length&&-1!==u.indexOf("back")&&(n=t[t.length-1]),n&&(e.video.deviceId=c.exact?{exact:n.deviceId}:{ideal:n.deviceId}),e.video=s(e.video),o("chrome: "+JSON.stringify(e)),i(e)});e.video=s(e.video)}return o("chrome: "+JSON.stringify(e)),i(e)},c=function(e){return{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[e.name]||e.name,message:e.message,constraint:e.constraintName,toString:function(){return this.name+(this.message&&": ")+this.message}}};r.getUserMedia=function(e,t,n){a(e,function(e){r.webkitGetUserMedia(e,t,function(e){n&&n(c(e))})})};var u=function(e){return new Promise(function(t,n){r.getUserMedia(e,t,n)})};if(r.mediaDevices||(r.mediaDevices={getUserMedia:u,enumerateDevices:function(){return new Promise(function(t){var n={audio:"audioinput",video:"videoinput"};return e.MediaStreamTrack.getSources(function(e){t(e.map(function(e){return{label:e.label,kind:n[e.kind],deviceId:e.id,groupId:""}}))})})},getSupportedConstraints:function(){return{deviceId:!0,echoCancellation:!0,facingMode:!0,frameRate:!0,height:!0,width:!0}}}),r.mediaDevices.getUserMedia){var d=r.mediaDevices.getUserMedia.bind(r.mediaDevices);r.mediaDevices.getUserMedia=function(e){return a(e,function(e){return d(e).then(function(t){if(e.audio&&!t.getAudioTracks().length||e.video&&!t.getVideoTracks().length)throw t.getTracks().forEach(function(e){e.stop()}),new DOMException("","NotFoundError");return t},function(e){return Promise.reject(c(e))})})}}else r.mediaDevices.getUserMedia=function(e){return u(e)};void 0===r.mediaDevices.addEventListener&&(r.mediaDevices.addEventListener=function(){o("Dummy mediaDevices.addEventListener called.")}),void 0===r.mediaDevices.removeEventListener&&(r.mediaDevices.removeEventListener=function(){o("Dummy mediaDevices.removeEventListener called.")})}},{"../utils.js":14}],7:[function(e,t,r){"use strict";var i=e("sdp"),o=e("./utils");t.exports={shimRTCIceCandidate:function(e){if(e.RTCIceCandidate&&!(e.RTCIceCandidate&&"foundation"in e.RTCIceCandidate.prototype)){var t=e.RTCIceCandidate;e.RTCIceCandidate=function(e){if("object"===(void 0===e?"undefined":n(e))&&e.candidate&&0===e.candidate.indexOf("a=")&&((e=JSON.parse(JSON.stringify(e))).candidate=e.candidate.substr(2)),e.candidate&&e.candidate.length){var r=new t(e),o=i.parseCandidate(e.candidate),s=Object.assign(r,o);return s.toJSON=function(){return{candidate:s.candidate,sdpMid:s.sdpMid,sdpMLineIndex:s.sdpMLineIndex,usernameFragment:s.usernameFragment}},s}return new t(e)},e.RTCIceCandidate.prototype=t.prototype,o.wrapPeerConnectionEvent(e,"icecandidate",function(t){return t.candidate&&Object.defineProperty(t,"candidate",{value:new e.RTCIceCandidate(t.candidate),writable:"false"}),t})}},shimCreateObjectURL:function(e){var t=e&&e.URL;if("object"===(void 0===e?"undefined":n(e))&&e.HTMLMediaElement&&"srcObject"in e.HTMLMediaElement.prototype&&t.createObjectURL&&t.revokeObjectURL){var r=t.createObjectURL.bind(t),i=t.revokeObjectURL.bind(t),s=new Map,a=0;t.createObjectURL=function(e){if("getTracks"in e){var t="polyblob:"+ ++a;return s.set(t,e),o.deprecated("URL.createObjectURL(stream)","elem.srcObject = stream"),t}return r(e)},t.revokeObjectURL=function(e){i(e),s.delete(e)};var c=Object.getOwnPropertyDescriptor(e.HTMLMediaElement.prototype,"src");Object.defineProperty(e.HTMLMediaElement.prototype,"src",{get:function(){return c.get.apply(this)},set:function(e){return this.srcObject=s.get(e)||null,c.set.apply(this,[e])}});var u=e.HTMLMediaElement.prototype.setAttribute;e.HTMLMediaElement.prototype.setAttribute=function(){return 2===arguments.length&&"src"===(""+arguments[0]).toLowerCase()&&(this.srcObject=s.get(arguments[1])||null),u.apply(this,arguments)}}},shimMaxMessageSize:function(e){if(!e.RTCSctpTransport&&e.RTCPeerConnection){var t=o.detectBrowser(e);"sctp"in e.RTCPeerConnection.prototype||Object.defineProperty(e.RTCPeerConnection.prototype,"sctp",{get:function(){return void 0===this._sctp?null:this._sctp}});var n=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){var e,r,o,s;if(this._sctp=null,o=arguments[0],(s=i.splitSections(o.sdp)).shift(),s.some(function(e){var t=i.parseMLine(e);return t&&"application"===t.kind&&-1!==t.protocol.indexOf("SCTP")})){var a,c=function(e){var t=e.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(null===t||t.length<2)return-1;var n=parseInt(t[1],10);return n!=n?-1:n}(arguments[0]),u=(e=c,r=65536,"firefox"===t.browser&&(r=t.version<57?-1===e?16384:2147483637:t.version<60?57===t.version?65535:65536:2147483637),r),d=function(e,n){var r=65536;"firefox"===t.browser&&57===t.version&&(r=65535);var o=i.matchPrefix(e.sdp,"a=max-message-size:");return o.length>0?r=parseInt(o[0].substr(19),10):"firefox"===t.browser&&-1!==n&&(r=2147483637),r}(arguments[0],c);a=0===u&&0===d?Number.POSITIVE_INFINITY:0===u||0===d?Math.max(u,d):Math.min(u,d);var l={};Object.defineProperty(l,"maxMessageSize",{get:function(){return a}}),this._sctp=l}return n.apply(this,arguments)}}},shimSendThrowTypeError:function(e){if(e.RTCPeerConnection&&"createDataChannel"in e.RTCPeerConnection.prototype){var t=e.RTCPeerConnection.prototype.createDataChannel;e.RTCPeerConnection.prototype.createDataChannel=function(){var e=t.apply(this,arguments);return n(e,this),e},o.wrapPeerConnectionEvent(e,"datachannel",function(e){return n(e.channel,e.target),e})}function n(e,t){var n=e.send;e.send=function(){var r=arguments[0],i=r.length||r.size||r.byteLength;if("open"===e.readyState&&t.sctp&&i>t.sctp.maxMessageSize)throw new TypeError("Message too large (can send a maximum of "+t.sctp.maxMessageSize+" bytes)");return n.apply(e,arguments)}}}}},{"./utils":14,sdp:2}],8:[function(e,t,n){"use strict";var r=e("../utils"),i=e("./filtericeservers"),o=e("rtcpeerconnection-shim");t.exports={shimGetUserMedia:e("./getusermedia"),shimPeerConnection:function(e){var t=r.detectBrowser(e);if(e.RTCIceGatherer&&(e.RTCIceCandidate||(e.RTCIceCandidate=function(e){return e}),e.RTCSessionDescription||(e.RTCSessionDescription=function(e){return e}),t.version<15025)){var n=Object.getOwnPropertyDescriptor(e.MediaStreamTrack.prototype,"enabled");Object.defineProperty(e.MediaStreamTrack.prototype,"enabled",{set:function(e){n.set.call(this,e);var t=new Event("enabled");t.enabled=e,this.dispatchEvent(t)}})}!e.RTCRtpSender||"dtmf"in e.RTCRtpSender.prototype||Object.defineProperty(e.RTCRtpSender.prototype,"dtmf",{get:function(){return void 0===this._dtmf&&("audio"===this.track.kind?this._dtmf=new e.RTCDtmfSender(this):"video"===this.track.kind&&(this._dtmf=null)),this._dtmf}}),e.RTCDtmfSender&&!e.RTCDTMFSender&&(e.RTCDTMFSender=e.RTCDtmfSender);var s=o(e,t.version);e.RTCPeerConnection=function(e){return e.iceServers&&(e.iceServers=i(e.iceServers)),new s(e)},e.RTCPeerConnection.prototype=s.prototype},shimReplaceTrack:function(e){!e.RTCRtpSender||"replaceTrack"in e.RTCRtpSender.prototype||(e.RTCRtpSender.prototype.replaceTrack=e.RTCRtpSender.prototype.setTrack)}}},{"../utils":14,"./filtericeservers":9,"./getusermedia":10,"rtcpeerconnection-shim":1}],9:[function(e,t,n){"use strict";var r=e("../utils");t.exports=function(e,t){var n=!1;return(e=JSON.parse(JSON.stringify(e))).filter(function(e){if(e&&(e.urls||e.url)){var i=e.urls||e.url;e.url&&!e.urls&&r.deprecated("RTCIceServer.url","RTCIceServer.urls");var o="string"==typeof i;return o&&(i=[i]),i=i.filter(function(e){return 0===e.indexOf("turn:")&&-1!==e.indexOf("transport=udp")&&-1===e.indexOf("turn:[")&&!n?(n=!0,!0):0===e.indexOf("stun:")&&t>=14393&&-1===e.indexOf("?transport=udp")}),delete e.url,e.urls=o?i[0]:i,!!i.length}})}},{"../utils":14}],10:[function(e,t,n){"use strict";t.exports=function(e){var t=e&&e.navigator,n=t.mediaDevices.getUserMedia.bind(t.mediaDevices);t.mediaDevices.getUserMedia=function(e){return n(e).catch(function(e){return Promise.reject(function(e){return{name:{PermissionDeniedError:"NotAllowedError"}[e.name]||e.name,message:e.message,constraint:e.constraint,toString:function(){return this.name}}}(e))})}}},{}],11:[function(e,t,r){"use strict";var i=e("../utils");t.exports={shimGetUserMedia:e("./getusermedia"),shimOnTrack:function(e){"object"!==(void 0===e?"undefined":n(e))||!e.RTCPeerConnection||"ontrack"in e.RTCPeerConnection.prototype||Object.defineProperty(e.RTCPeerConnection.prototype,"ontrack",{get:function(){return this._ontrack},set:function(e){this._ontrack&&(this.removeEventListener("track",this._ontrack),this.removeEventListener("addstream",this._ontrackpoly)),this.addEventListener("track",this._ontrack=e),this.addEventListener("addstream",this._ontrackpoly=function(e){e.stream.getTracks().forEach(function(t){var n=new Event("track");n.track=t,n.receiver={track:t},n.transceiver={receiver:n.receiver},n.streams=[e.stream],this.dispatchEvent(n)}.bind(this))}.bind(this))}}),"object"===(void 0===e?"undefined":n(e))&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get:function(){return{receiver:this.receiver}}})},shimSourceObject:function(e){"object"===(void 0===e?"undefined":n(e))&&(!e.HTMLMediaElement||"srcObject"in e.HTMLMediaElement.prototype||Object.defineProperty(e.HTMLMediaElement.prototype,"srcObject",{get:function(){return this.mozSrcObject},set:function(e){this.mozSrcObject=e}}))},shimPeerConnection:function(e){var t=i.detectBrowser(e);if("object"===(void 0===e?"undefined":n(e))&&(e.RTCPeerConnection||e.mozRTCPeerConnection)){e.RTCPeerConnection||(e.RTCPeerConnection=function(n,r){if(t.version<38&&n&&n.iceServers){for(var i=[],o=0;o<n.iceServers.length;o++){var s=n.iceServers[o];if(s.hasOwnProperty("urls"))for(var a=0;a<s.urls.length;a++){var c={url:s.urls[a]};0===s.urls[a].indexOf("turn")&&(c.username=s.username,c.credential=s.credential),i.push(c)}else i.push(n.iceServers[o])}n.iceServers=i}return new e.mozRTCPeerConnection(n,r)},e.RTCPeerConnection.prototype=e.mozRTCPeerConnection.prototype,e.mozRTCPeerConnection.generateCertificate&&Object.defineProperty(e.RTCPeerConnection,"generateCertificate",{get:function(){return e.mozRTCPeerConnection.generateCertificate}}),e.RTCSessionDescription=e.mozRTCSessionDescription,e.RTCIceCandidate=e.mozRTCIceCandidate),["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(t){var n=e.RTCPeerConnection.prototype[t];e.RTCPeerConnection.prototype[t]=function(){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}});var r=e.RTCPeerConnection.prototype.addIceCandidate;e.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?r.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())};var o={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},s=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(e,n,r){return s.apply(this,[e||null]).then(function(e){if(t.version<48&&(e=function(e){var t=new Map;return Object.keys(e).forEach(function(n){t.set(n,e[n]),t[n]=e[n]}),t}(e)),t.version<53&&!n)try{e.forEach(function(e){e.type=o[e.type]||e.type})}catch(r){if("TypeError"!==r.name)throw r;e.forEach(function(t,n){e.set(n,Object.assign({},t,{type:o[t.type]||t.type}))})}return e}).then(n,r)}}},shimSenderGetStats:function(e){if("object"===(void 0===e?"undefined":n(e))&&e.RTCPeerConnection&&e.RTCRtpSender&&!(e.RTCRtpSender&&"getStats"in e.RTCRtpSender.prototype)){var t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){var e=this,n=t.apply(e,[]);return n.forEach(function(t){t._pc=e}),n});var r=e.RTCPeerConnection.prototype.addTrack;r&&(e.RTCPeerConnection.prototype.addTrack=function(){var e=r.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):Promise.resolve(new Map)}}},shimReceiverGetStats:function(e){if("object"===(void 0===e?"undefined":n(e))&&e.RTCPeerConnection&&e.RTCRtpSender&&!(e.RTCRtpSender&&"getStats"in e.RTCRtpReceiver.prototype)){var t=e.RTCPeerConnection.prototype.getReceivers;t&&(e.RTCPeerConnection.prototype.getReceivers=function(){var e=this,n=t.apply(e,[]);return n.forEach(function(t){t._pc=e}),n}),i.wrapPeerConnectionEvent(e,"track",function(e){return e.receiver._pc=e.srcElement,e}),e.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}},shimRemoveStream:function(e){!e.RTCPeerConnection||"removeStream"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.removeStream=function(e){var t=this;i.deprecated("removeStream","removeTrack"),this.getSenders().forEach(function(n){n.track&&-1!==e.getTracks().indexOf(n.track)&&t.removeTrack(n)})})},shimRTCDataChannel:function(e){e.DataChannel&&!e.RTCDataChannel&&(e.RTCDataChannel=e.DataChannel)}}},{"../utils":14,"./getusermedia":12}],12:[function(e,t,r){"use strict";var i=e("../utils"),o=i.log;t.exports=function(e){var t=i.detectBrowser(e),r=e&&e.navigator,s=e&&e.MediaStreamTrack,a=function(e){return{name:{InternalError:"NotReadableError",NotSupportedError:"TypeError",PermissionDeniedError:"NotAllowedError",SecurityError:"NotAllowedError"}[e.name]||e.name,message:{"The operation is insecure.":"The request is not allowed by the user agent or the platform in the current context."}[e.message]||e.message,constraint:e.constraint,toString:function(){return this.name+(this.message&&": ")+this.message}}},c=function(e,i,s){var c=function(e){if("object"!==(void 0===e?"undefined":n(e))||e.require)return e;var t=[];return Object.keys(e).forEach(function(r){if("require"!==r&&"advanced"!==r&&"mediaSource"!==r){var i=e[r]="object"===n(e[r])?e[r]:{ideal:e[r]};if(void 0===i.min&&void 0===i.max&&void 0===i.exact||t.push(r),void 0!==i.exact&&("number"==typeof i.exact?i.min=i.max=i.exact:e[r]=i.exact,delete i.exact),void 0!==i.ideal){e.advanced=e.advanced||[];var o={};"number"==typeof i.ideal?o[r]={min:i.ideal,max:i.ideal}:o[r]=i.ideal,e.advanced.push(o),delete i.ideal,Object.keys(i).length||delete e[r]}}}),t.length&&(e.require=t),e};return e=JSON.parse(JSON.stringify(e)),t.version<38&&(o("spec: "+JSON.stringify(e)),e.audio&&(e.audio=c(e.audio)),e.video&&(e.video=c(e.video)),o("ff37: "+JSON.stringify(e))),r.mozGetUserMedia(e,i,function(e){s(a(e))})};if(r.mediaDevices||(r.mediaDevices={getUserMedia:function(e){return new Promise(function(t,n){c(e,t,n)})},addEventListener:function(){},removeEventListener:function(){}}),r.mediaDevices.enumerateDevices=r.mediaDevices.enumerateDevices||function(){return new Promise(function(e){e([{kind:"audioinput",deviceId:"default",label:"",groupId:""},{kind:"videoinput",deviceId:"default",label:"",groupId:""}])})},t.version<41){var u=r.mediaDevices.enumerateDevices.bind(r.mediaDevices);r.mediaDevices.enumerateDevices=function(){return u().then(void 0,function(e){if("NotFoundError"===e.name)return[];throw e})}}if(t.version<49){var d=r.mediaDevices.getUserMedia.bind(r.mediaDevices);r.mediaDevices.getUserMedia=function(e){return d(e).then(function(t){if(e.audio&&!t.getAudioTracks().length||e.video&&!t.getVideoTracks().length)throw t.getTracks().forEach(function(e){e.stop()}),new DOMException("The object can not be found here.","NotFoundError");return t},function(e){return Promise.reject(a(e))})}}if(!(t.version>55&&"autoGainControl"in r.mediaDevices.getSupportedConstraints())){var l=function(e,t,n){t in e&&!(n in e)&&(e[n]=e[t],delete e[t])},f=r.mediaDevices.getUserMedia.bind(r.mediaDevices);if(r.mediaDevices.getUserMedia=function(e){return"object"===(void 0===e?"undefined":n(e))&&"object"===n(e.audio)&&(e=JSON.parse(JSON.stringify(e)),l(e.audio,"autoGainControl","mozAutoGainControl"),l(e.audio,"noiseSuppression","mozNoiseSuppression")),f(e)},s&&s.prototype.getSettings){var p=s.prototype.getSettings;s.prototype.getSettings=function(){var e=p.apply(this,arguments);return l(e,"mozAutoGainControl","autoGainControl"),l(e,"mozNoiseSuppression","noiseSuppression"),e}}if(s&&s.prototype.applyConstraints){var h=s.prototype.applyConstraints;s.prototype.applyConstraints=function(e){return"audio"===this.kind&&"object"===(void 0===e?"undefined":n(e))&&(e=JSON.parse(JSON.stringify(e)),l(e,"autoGainControl","mozAutoGainControl"),l(e,"noiseSuppression","mozNoiseSuppression")),h.apply(this,[e])}}}r.getUserMedia=function(e,n,o){if(t.version<44)return c(e,n,o);i.deprecated("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),r.mediaDevices.getUserMedia(e).then(n,o)}}},{"../utils":14}],13:[function(e,t,r){"use strict";var i=e("../utils");t.exports={shimLocalStreamsAPI:function(e){if("object"===(void 0===e?"undefined":n(e))&&e.RTCPeerConnection){if("getLocalStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),"getStreamById"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getStreamById=function(e){var t=null;return this._localStreams&&this._localStreams.forEach(function(n){n.id===e&&(t=n)}),this._remoteStreams&&this._remoteStreams.forEach(function(n){n.id===e&&(t=n)}),t}),!("addStream"in e.RTCPeerConnection.prototype)){var t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addStream=function(e){this._localStreams||(this._localStreams=[]),-1===this._localStreams.indexOf(e)&&this._localStreams.push(e);var n=this;e.getTracks().forEach(function(r){t.call(n,r,e)})},e.RTCPeerConnection.prototype.addTrack=function(e,n){return n&&(this._localStreams?-1===this._localStreams.indexOf(n)&&this._localStreams.push(n):this._localStreams=[n]),t.call(this,e,n)}}"removeStream"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.removeStream=function(e){this._localStreams||(this._localStreams=[]);var t=this._localStreams.indexOf(e);if(-1!==t){this._localStreams.splice(t,1);var n=this,r=e.getTracks();this.getSenders().forEach(function(e){-1!==r.indexOf(e.track)&&n.removeTrack(e)})}})}},shimRemoteStreamsAPI:function(e){"object"===(void 0===e?"undefined":n(e))&&e.RTCPeerConnection&&("getRemoteStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),"onaddstream"in e.RTCPeerConnection.prototype||Object.defineProperty(e.RTCPeerConnection.prototype,"onaddstream",{get:function(){return this._onaddstream},set:function(e){var t=this;this._onaddstream&&(this.removeEventListener("addstream",this._onaddstream),this.removeEventListener("track",this._onaddstreampoly)),this.addEventListener("addstream",this._onaddstream=e),this.addEventListener("track",this._onaddstreampoly=function(e){e.streams.forEach(function(e){if(t._remoteStreams||(t._remoteStreams=[]),!(t._remoteStreams.indexOf(e)>=0)){t._remoteStreams.push(e);var n=new Event("addstream");n.stream=e,t.dispatchEvent(n)}})})}}))},shimCallbacksAPI:function(e){if("object"===(void 0===e?"undefined":n(e))&&e.RTCPeerConnection){var t=e.RTCPeerConnection.prototype,r=t.createOffer,i=t.createAnswer,o=t.setLocalDescription,s=t.setRemoteDescription,a=t.addIceCandidate;t.createOffer=function(e,t){var n=arguments.length>=2?arguments[2]:arguments[0],i=r.apply(this,[n]);return t?(i.then(e,t),Promise.resolve()):i},t.createAnswer=function(e,t){var n=arguments.length>=2?arguments[2]:arguments[0],r=i.apply(this,[n]);return t?(r.then(e,t),Promise.resolve()):r};var c=function(e,t,n){var r=o.apply(this,[e]);return n?(r.then(t,n),Promise.resolve()):r};t.setLocalDescription=c,c=function(e,t,n){var r=s.apply(this,[e]);return n?(r.then(t,n),Promise.resolve()):r},t.setRemoteDescription=c,c=function(e,t,n){var r=a.apply(this,[e]);return n?(r.then(t,n),Promise.resolve()):r},t.addIceCandidate=c}},shimGetUserMedia:function(e){var t=e&&e.navigator;t.getUserMedia||(t.webkitGetUserMedia?t.getUserMedia=t.webkitGetUserMedia.bind(t):t.mediaDevices&&t.mediaDevices.getUserMedia&&(t.getUserMedia=function(e,n,r){t.mediaDevices.getUserMedia(e).then(n,r)}.bind(t)))},shimRTCIceServerUrls:function(e){var t=e.RTCPeerConnection;e.RTCPeerConnection=function(e,n){if(e&&e.iceServers){for(var r=[],o=0;o<e.iceServers.length;o++){var s=e.iceServers[o];!s.hasOwnProperty("urls")&&s.hasOwnProperty("url")?(i.deprecated("RTCIceServer.url","RTCIceServer.urls"),(s=JSON.parse(JSON.stringify(s))).urls=s.url,delete s.url,r.push(s)):r.push(e.iceServers[o])}e.iceServers=r}return new t(e,n)},e.RTCPeerConnection.prototype=t.prototype,"generateCertificate"in e.RTCPeerConnection&&Object.defineProperty(e.RTCPeerConnection,"generateCertificate",{get:function(){return t.generateCertificate}})},shimTrackEventTransceiver:function(e){"object"===(void 0===e?"undefined":n(e))&&e.RTCPeerConnection&&"receiver"in e.RTCTrackEvent.prototype&&!e.RTCTransceiver&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get:function(){return{receiver:this.receiver}}})},shimCreateOfferLegacy:function(e){var t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(e){var n=this;if(e){void 0!==e.offerToReceiveAudio&&(e.offerToReceiveAudio=!!e.offerToReceiveAudio);var r=n.getTransceivers().find(function(e){return e.sender.track&&"audio"===e.sender.track.kind});!1===e.offerToReceiveAudio&&r?"sendrecv"===r.direction?r.setDirection?r.setDirection("sendonly"):r.direction="sendonly":"recvonly"===r.direction&&(r.setDirection?r.setDirection("inactive"):r.direction="inactive"):!0!==e.offerToReceiveAudio||r||n.addTransceiver("audio"),void 0!==e.offerToReceiveAudio&&(e.offerToReceiveVideo=!!e.offerToReceiveVideo);var i=n.getTransceivers().find(function(e){return e.sender.track&&"video"===e.sender.track.kind});!1===e.offerToReceiveVideo&&i?"sendrecv"===i.direction?i.setDirection("sendonly"):"recvonly"===i.direction&&i.setDirection("inactive"):!0!==e.offerToReceiveVideo||i||n.addTransceiver("video")}return t.apply(n,arguments)}}}},{"../utils":14}],14:[function(e,t,r){"use strict";var i=!0,o=!0;function s(e,t,n){var r=e.match(t);return r&&r.length>=n&&parseInt(r[n],10)}t.exports={extractVersion:s,wrapPeerConnectionEvent:function(e,t,n){if(e.RTCPeerConnection){var r=e.RTCPeerConnection.prototype,i=r.addEventListener;r.addEventListener=function(e,r){if(e!==t)return i.apply(this,arguments);var o=function(e){r(n(e))};return this._eventMap=this._eventMap||{},this._eventMap[r]=o,i.apply(this,[e,o])};var o=r.removeEventListener;r.removeEventListener=function(e,n){if(e!==t||!this._eventMap||!this._eventMap[n])return o.apply(this,arguments);var r=this._eventMap[n];return delete this._eventMap[n],o.apply(this,[e,r])},Object.defineProperty(r,"on"+t,{get:function(){return this["_on"+t]},set:function(e){this["_on"+t]&&(this.removeEventListener(t,this["_on"+t]),delete this["_on"+t]),e&&this.addEventListener(t,this["_on"+t]=e)},enumerable:!0,configurable:!0})}},disableLog:function(e){return"boolean"!=typeof e?new Error("Argument type: "+(void 0===e?"undefined":n(e))+". Please use a boolean."):(i=e,e?"adapter.js logging disabled":"adapter.js logging enabled")},disableWarnings:function(e){return"boolean"!=typeof e?new Error("Argument type: "+(void 0===e?"undefined":n(e))+". Please use a boolean."):(o=!e,"adapter.js deprecation warnings "+(e?"disabled":"enabled"))},log:function(){if("object"===("undefined"==typeof window?"undefined":n(window))){if(i)return;"undefined"!=typeof console&&"function"==typeof console.log&&console.log.apply(console,arguments)}},deprecated:function(e,t){o&&console.warn(e+" is deprecated, please use "+t+" instead.")},detectBrowser:function(e){var t=e&&e.navigator,n={browser:null,version:null};if(void 0===e||!e.navigator)return n.browser="Not a browser.",n;if(t.mozGetUserMedia)n.browser="firefox",n.version=s(t.userAgent,/Firefox\/(\d+)\./,1);else if(t.webkitGetUserMedia)n.browser="chrome",n.version=s(t.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else if(t.mediaDevices&&t.userAgent.match(/Edge\/(\d+).(\d+)$/))n.browser="edge",n.version=s(t.userAgent,/Edge\/(\d+).(\d+)$/,2);else{if(!e.RTCPeerConnection||!t.userAgent.match(/AppleWebKit\/(\d+)\./))return n.browser="Not a supported browser.",n;n.browser="safari",n.version=s(t.userAgent,/AppleWebKit\/(\d+)\./,1)}return n}}},{}]},{},[3])(3)})},,,function(e,t,n){n(7)(n(8)),e.exports=window.Zepto},function(e,t){e.exports=function(e){function t(e){"undefined"!=typeof console&&(console.error||console.log)("[Script Loader]",e)}try{"undefined"!=typeof execScript&&"undefined"!=typeof attachEvent&&"undefined"==typeof addEventListener?execScript(e):"undefined"!=typeof eval?eval.call(null,e):t("EvalError: No eval function available")}catch(n){t(n)}}},function(e,t){e.exports="/* Zepto v1.2.0 - zepto event ajax form ie - zeptojs.com/license */\n(function(global, factory) {\n  if (typeof define === 'function' && define.amd)\n    define(function() { return factory(global) })\n  else\n    factory(global)\n}(this, function(window) {\n  var Zepto = (function() {\n  var undefined, key, $, classList, emptyArray = [], concat = emptyArray.concat, filter = emptyArray.filter, slice = emptyArray.slice,\n    document = window.document,\n    elementDisplay = {}, classCache = {},\n    cssNumber = { 'column-count': 1, 'columns': 1, 'font-weight': 1, 'line-height': 1,'opacity': 1, 'z-index': 1, 'zoom': 1 },\n    fragmentRE = /^\\s*<(\\w+|!)[^>]*>/,\n    singleTagRE = /^<(\\w+)\\s*\\/?>(?:<\\/\\1>|)$/,\n    tagExpanderRE = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\\w:]+)[^>]*)\\/>/ig,\n    rootNodeRE = /^(?:body|html)$/i,\n    capitalRE = /([A-Z])/g,\n\n    // special attributes that should be get/set via method calls\n    methodAttributes = ['val', 'css', 'html', 'text', 'data', 'width', 'height', 'offset'],\n\n    adjacencyOperators = [ 'after', 'prepend', 'before', 'append' ],\n    table = document.createElement('table'),\n    tableRow = document.createElement('tr'),\n    containers = {\n      'tr': document.createElement('tbody'),\n      'tbody': table, 'thead': table, 'tfoot': table,\n      'td': tableRow, 'th': tableRow,\n      '*': document.createElement('div')\n    },\n    readyRE = /complete|loaded|interactive/,\n    simpleSelectorRE = /^[\\w-]*$/,\n    class2type = {},\n    toString = class2type.toString,\n    zepto = {},\n    camelize, uniq,\n    tempParent = document.createElement('div'),\n    propMap = {\n      'tabindex': 'tabIndex',\n      'readonly': 'readOnly',\n      'for': 'htmlFor',\n      'class': 'className',\n      'maxlength': 'maxLength',\n      'cellspacing': 'cellSpacing',\n      'cellpadding': 'cellPadding',\n      'rowspan': 'rowSpan',\n      'colspan': 'colSpan',\n      'usemap': 'useMap',\n      'frameborder': 'frameBorder',\n      'contenteditable': 'contentEditable'\n    },\n    isArray = Array.isArray ||\n      function(object){ return object instanceof Array }\n\n  zepto.matches = function(element, selector) {\n    if (!selector || !element || element.nodeType !== 1) return false\n    var matchesSelector = element.matches || element.webkitMatchesSelector ||\n                          element.mozMatchesSelector || element.oMatchesSelector ||\n                          element.matchesSelector\n    if (matchesSelector) return matchesSelector.call(element, selector)\n    // fall back to performing a selector:\n    var match, parent = element.parentNode, temp = !parent\n    if (temp) (parent = tempParent).appendChild(element)\n    match = ~zepto.qsa(parent, selector).indexOf(element)\n    temp && tempParent.removeChild(element)\n    return match\n  }\n\n  function type(obj) {\n    return obj == null ? String(obj) :\n      class2type[toString.call(obj)] || \"object\"\n  }\n\n  function isFunction(value) { return type(value) == \"function\" }\n  function isWindow(obj)     { return obj != null && obj == obj.window }\n  function isDocument(obj)   { return obj != null && obj.nodeType == obj.DOCUMENT_NODE }\n  function isObject(obj)     { return type(obj) == \"object\" }\n  function isPlainObject(obj) {\n    return isObject(obj) && !isWindow(obj) && Object.getPrototypeOf(obj) == Object.prototype\n  }\n\n  function likeArray(obj) {\n    var length = !!obj && 'length' in obj && obj.length,\n      type = $.type(obj)\n\n    return 'function' != type && !isWindow(obj) && (\n      'array' == type || length === 0 ||\n        (typeof length == 'number' && length > 0 && (length - 1) in obj)\n    )\n  }\n\n  function compact(array) { return filter.call(array, function(item){ return item != null }) }\n  function flatten(array) { return array.length > 0 ? $.fn.concat.apply([], array) : array }\n  camelize = function(str){ return str.replace(/-+(.)?/g, function(match, chr){ return chr ? chr.toUpperCase() : '' }) }\n  function dasherize(str) {\n    return str.replace(/::/g, '/')\n           .replace(/([A-Z]+)([A-Z][a-z])/g, '$1_$2')\n           .replace(/([a-z\\d])([A-Z])/g, '$1_$2')\n           .replace(/_/g, '-')\n           .toLowerCase()\n  }\n  uniq = function(array){ return filter.call(array, function(item, idx){ return array.indexOf(item) == idx }) }\n\n  function classRE(name) {\n    return name in classCache ?\n      classCache[name] : (classCache[name] = new RegExp('(^|\\\\s)' + name + '(\\\\s|$)'))\n  }\n\n  function maybeAddPx(name, value) {\n    return (typeof value == \"number\" && !cssNumber[dasherize(name)]) ? value + \"px\" : value\n  }\n\n  function defaultDisplay(nodeName) {\n    var element, display\n    if (!elementDisplay[nodeName]) {\n      element = document.createElement(nodeName)\n      document.body.appendChild(element)\n      display = getComputedStyle(element, '').getPropertyValue(\"display\")\n      element.parentNode.removeChild(element)\n      display == \"none\" && (display = \"block\")\n      elementDisplay[nodeName] = display\n    }\n    return elementDisplay[nodeName]\n  }\n\n  function children(element) {\n    return 'children' in element ?\n      slice.call(element.children) :\n      $.map(element.childNodes, function(node){ if (node.nodeType == 1) return node })\n  }\n\n  function Z(dom, selector) {\n    var i, len = dom ? dom.length : 0\n    for (i = 0; i < len; i++) this[i] = dom[i]\n    this.length = len\n    this.selector = selector || ''\n  }\n\n  // `$.zepto.fragment` takes a html string and an optional tag name\n  // to generate DOM nodes from the given html string.\n  // The generated DOM nodes are returned as an array.\n  // This function can be overridden in plugins for example to make\n  // it compatible with browsers that don't support the DOM fully.\n  zepto.fragment = function(html, name, properties) {\n    var dom, nodes, container\n\n    // A special case optimization for a single tag\n    if (singleTagRE.test(html)) dom = $(document.createElement(RegExp.$1))\n\n    if (!dom) {\n      if (html.replace) html = html.replace(tagExpanderRE, \"<$1></$2>\")\n      if (name === undefined) name = fragmentRE.test(html) && RegExp.$1\n      if (!(name in containers)) name = '*'\n\n      container = containers[name]\n      container.innerHTML = '' + html\n      dom = $.each(slice.call(container.childNodes), function(){\n        container.removeChild(this)\n      })\n    }\n\n    if (isPlainObject(properties)) {\n      nodes = $(dom)\n      $.each(properties, function(key, value) {\n        if (methodAttributes.indexOf(key) > -1) nodes[key](value)\n        else nodes.attr(key, value)\n      })\n    }\n\n    return dom\n  }\n\n  // `$.zepto.Z` swaps out the prototype of the given `dom` array\n  // of nodes with `$.fn` and thus supplying all the Zepto functions\n  // to the array. This method can be overridden in plugins.\n  zepto.Z = function(dom, selector) {\n    return new Z(dom, selector)\n  }\n\n  // `$.zepto.isZ` should return `true` if the given object is a Zepto\n  // collection. This method can be overridden in plugins.\n  zepto.isZ = function(object) {\n    return object instanceof zepto.Z\n  }\n\n  // `$.zepto.init` is Zepto's counterpart to jQuery's `$.fn.init` and\n  // takes a CSS selector and an optional context (and handles various\n  // special cases).\n  // This method can be overridden in plugins.\n  zepto.init = function(selector, context) {\n    var dom\n    // If nothing given, return an empty Zepto collection\n    if (!selector) return zepto.Z()\n    // Optimize for string selectors\n    else if (typeof selector == 'string') {\n      selector = selector.trim()\n      // If it's a html fragment, create nodes from it\n      // Note: In both Chrome 21 and Firefox 15, DOM error 12\n      // is thrown if the fragment doesn't begin with <\n      if (selector[0] == '<' && fragmentRE.test(selector))\n        dom = zepto.fragment(selector, RegExp.$1, context), selector = null\n      // If there's a context, create a collection on that context first, and select\n      // nodes from there\n      else if (context !== undefined) return $(context).find(selector)\n      // If it's a CSS selector, use it to select nodes.\n      else dom = zepto.qsa(document, selector)\n    }\n    // If a function is given, call it when the DOM is ready\n    else if (isFunction(selector)) return $(document).ready(selector)\n    // If a Zepto collection is given, just return it\n    else if (zepto.isZ(selector)) return selector\n    else {\n      // normalize array if an array of nodes is given\n      if (isArray(selector)) dom = compact(selector)\n      // Wrap DOM nodes.\n      else if (isObject(selector))\n        dom = [selector], selector = null\n      // If it's a html fragment, create nodes from it\n      else if (fragmentRE.test(selector))\n        dom = zepto.fragment(selector.trim(), RegExp.$1, context), selector = null\n      // If there's a context, create a collection on that context first, and select\n      // nodes from there\n      else if (context !== undefined) return $(context).find(selector)\n      // And last but no least, if it's a CSS selector, use it to select nodes.\n      else dom = zepto.qsa(document, selector)\n    }\n    // create a new Zepto collection from the nodes found\n    return zepto.Z(dom, selector)\n  }\n\n  // `$` will be the base `Zepto` object. When calling this\n  // function just call `$.zepto.init, which makes the implementation\n  // details of selecting nodes and creating Zepto collections\n  // patchable in plugins.\n  $ = function(selector, context){\n    return zepto.init(selector, context)\n  }\n\n  function extend(target, source, deep) {\n    for (key in source)\n      if (deep && (isPlainObject(source[key]) || isArray(source[key]))) {\n        if (isPlainObject(source[key]) && !isPlainObject(target[key]))\n          target[key] = {}\n        if (isArray(source[key]) && !isArray(target[key]))\n          target[key] = []\n        extend(target[key], source[key], deep)\n      }\n      else if (source[key] !== undefined) target[key] = source[key]\n  }\n\n  // Copy all but undefined properties from one or more\n  // objects to the `target` object.\n  $.extend = function(target){\n    var deep, args = slice.call(arguments, 1)\n    if (typeof target == 'boolean') {\n      deep = target\n      target = args.shift()\n    }\n    args.forEach(function(arg){ extend(target, arg, deep) })\n    return target\n  }\n\n  // `$.zepto.qsa` is Zepto's CSS selector implementation which\n  // uses `document.querySelectorAll` and optimizes for some special cases, like `#id`.\n  // This method can be overridden in plugins.\n  zepto.qsa = function(element, selector){\n    var found,\n        maybeID = selector[0] == '#',\n        maybeClass = !maybeID && selector[0] == '.',\n        nameOnly = maybeID || maybeClass ? selector.slice(1) : selector, // Ensure that a 1 char tag name still gets checked\n        isSimple = simpleSelectorRE.test(nameOnly)\n    return (element.getElementById && isSimple && maybeID) ? // Safari DocumentFragment doesn't have getElementById\n      ( (found = element.getElementById(nameOnly)) ? [found] : [] ) :\n      (element.nodeType !== 1 && element.nodeType !== 9 && element.nodeType !== 11) ? [] :\n      slice.call(\n        isSimple && !maybeID && element.getElementsByClassName ? // DocumentFragment doesn't have getElementsByClassName/TagName\n          maybeClass ? element.getElementsByClassName(nameOnly) : // If it's simple, it could be a class\n          element.getElementsByTagName(selector) : // Or a tag\n          element.querySelectorAll(selector) // Or it's not simple, and we need to query all\n      )\n  }\n\n  function filtered(nodes, selector) {\n    return selector == null ? $(nodes) : $(nodes).filter(selector)\n  }\n\n  $.contains = document.documentElement.contains ?\n    function(parent, node) {\n      return parent !== node && parent.contains(node)\n    } :\n    function(parent, node) {\n      while (node && (node = node.parentNode))\n        if (node === parent) return true\n      return false\n    }\n\n  function funcArg(context, arg, idx, payload) {\n    return isFunction(arg) ? arg.call(context, idx, payload) : arg\n  }\n\n  function setAttribute(node, name, value) {\n    value == null ? node.removeAttribute(name) : node.setAttribute(name, value)\n  }\n\n  // access className property while respecting SVGAnimatedString\n  function className(node, value){\n    var klass = node.className || '',\n        svg   = klass && klass.baseVal !== undefined\n\n    if (value === undefined) return svg ? klass.baseVal : klass\n    svg ? (klass.baseVal = value) : (node.className = value)\n  }\n\n  // \"true\"  => true\n  // \"false\" => false\n  // \"null\"  => null\n  // \"42\"    => 42\n  // \"42.5\"  => 42.5\n  // \"08\"    => \"08\"\n  // JSON    => parse if valid\n  // String  => self\n  function deserializeValue(value) {\n    try {\n      return value ?\n        value == \"true\" ||\n        ( value == \"false\" ? false :\n          value == \"null\" ? null :\n          +value + \"\" == value ? +value :\n          /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n          value )\n        : value\n    } catch(e) {\n      return value\n    }\n  }\n\n  $.type = type\n  $.isFunction = isFunction\n  $.isWindow = isWindow\n  $.isArray = isArray\n  $.isPlainObject = isPlainObject\n\n  $.isEmptyObject = function(obj) {\n    var name\n    for (name in obj) return false\n    return true\n  }\n\n  $.isNumeric = function(val) {\n    var num = Number(val), type = typeof val\n    return val != null && type != 'boolean' &&\n      (type != 'string' || val.length) &&\n      !isNaN(num) && isFinite(num) || false\n  }\n\n  $.inArray = function(elem, array, i){\n    return emptyArray.indexOf.call(array, elem, i)\n  }\n\n  $.camelCase = camelize\n  $.trim = function(str) {\n    return str == null ? \"\" : String.prototype.trim.call(str)\n  }\n\n  // plugin compatibility\n  $.uuid = 0\n  $.support = { }\n  $.expr = { }\n  $.noop = function() {}\n\n  $.map = function(elements, callback){\n    var value, values = [], i, key\n    if (likeArray(elements))\n      for (i = 0; i < elements.length; i++) {\n        value = callback(elements[i], i)\n        if (value != null) values.push(value)\n      }\n    else\n      for (key in elements) {\n        value = callback(elements[key], key)\n        if (value != null) values.push(value)\n      }\n    return flatten(values)\n  }\n\n  $.each = function(elements, callback){\n    var i, key\n    if (likeArray(elements)) {\n      for (i = 0; i < elements.length; i++)\n        if (callback.call(elements[i], i, elements[i]) === false) return elements\n    } else {\n      for (key in elements)\n        if (callback.call(elements[key], key, elements[key]) === false) return elements\n    }\n\n    return elements\n  }\n\n  $.grep = function(elements, callback){\n    return filter.call(elements, callback)\n  }\n\n  if (window.JSON) $.parseJSON = JSON.parse\n\n  // Populate the class2type map\n  $.each(\"Boolean Number String Function Array Date RegExp Object Error\".split(\" \"), function(i, name) {\n    class2type[ \"[object \" + name + \"]\" ] = name.toLowerCase()\n  })\n\n  // Define methods that will be available on all\n  // Zepto collections\n  $.fn = {\n    constructor: zepto.Z,\n    length: 0,\n\n    // Because a collection acts like an array\n    // copy over these useful array functions.\n    forEach: emptyArray.forEach,\n    reduce: emptyArray.reduce,\n    push: emptyArray.push,\n    sort: emptyArray.sort,\n    splice: emptyArray.splice,\n    indexOf: emptyArray.indexOf,\n    concat: function(){\n      var i, value, args = []\n      for (i = 0; i < arguments.length; i++) {\n        value = arguments[i]\n        args[i] = zepto.isZ(value) ? value.toArray() : value\n      }\n      return concat.apply(zepto.isZ(this) ? this.toArray() : this, args)\n    },\n\n    // `map` and `slice` in the jQuery API work differently\n    // from their array counterparts\n    map: function(fn){\n      return $($.map(this, function(el, i){ return fn.call(el, i, el) }))\n    },\n    slice: function(){\n      return $(slice.apply(this, arguments))\n    },\n\n    ready: function(callback){\n      // need to check if document.body exists for IE as that browser reports\n      // document ready when it hasn't yet created the body element\n      if (readyRE.test(document.readyState) && document.body) callback($)\n      else document.addEventListener('DOMContentLoaded', function(){ callback($) }, false)\n      return this\n    },\n    get: function(idx){\n      return idx === undefined ? slice.call(this) : this[idx >= 0 ? idx : idx + this.length]\n    },\n    toArray: function(){ return this.get() },\n    size: function(){\n      return this.length\n    },\n    remove: function(){\n      return this.each(function(){\n        if (this.parentNode != null)\n          this.parentNode.removeChild(this)\n      })\n    },\n    each: function(callback){\n      emptyArray.every.call(this, function(el, idx){\n        return callback.call(el, idx, el) !== false\n      })\n      return this\n    },\n    filter: function(selector){\n      if (isFunction(selector)) return this.not(this.not(selector))\n      return $(filter.call(this, function(element){\n        return zepto.matches(element, selector)\n      }))\n    },\n    add: function(selector,context){\n      return $(uniq(this.concat($(selector,context))))\n    },\n    is: function(selector){\n      return this.length > 0 && zepto.matches(this[0], selector)\n    },\n    not: function(selector){\n      var nodes=[]\n      if (isFunction(selector) && selector.call !== undefined)\n        this.each(function(idx){\n          if (!selector.call(this,idx)) nodes.push(this)\n        })\n      else {\n        var excludes = typeof selector == 'string' ? this.filter(selector) :\n          (likeArray(selector) && isFunction(selector.item)) ? slice.call(selector) : $(selector)\n        this.forEach(function(el){\n          if (excludes.indexOf(el) < 0) nodes.push(el)\n        })\n      }\n      return $(nodes)\n    },\n    has: function(selector){\n      return this.filter(function(){\n        return isObject(selector) ?\n          $.contains(this, selector) :\n          $(this).find(selector).size()\n      })\n    },\n    eq: function(idx){\n      return idx === -1 ? this.slice(idx) : this.slice(idx, + idx + 1)\n    },\n    first: function(){\n      var el = this[0]\n      return el && !isObject(el) ? el : $(el)\n    },\n    last: function(){\n      var el = this[this.length - 1]\n      return el && !isObject(el) ? el : $(el)\n    },\n    find: function(selector){\n      var result, $this = this\n      if (!selector) result = $()\n      else if (typeof selector == 'object')\n        result = $(selector).filter(function(){\n          var node = this\n          return emptyArray.some.call($this, function(parent){\n            return $.contains(parent, node)\n          })\n        })\n      else if (this.length == 1) result = $(zepto.qsa(this[0], selector))\n      else result = this.map(function(){ return zepto.qsa(this, selector) })\n      return result\n    },\n    closest: function(selector, context){\n      var nodes = [], collection = typeof selector == 'object' && $(selector)\n      this.each(function(_, node){\n        while (node && !(collection ? collection.indexOf(node) >= 0 : zepto.matches(node, selector)))\n          node = node !== context && !isDocument(node) && node.parentNode\n        if (node && nodes.indexOf(node) < 0) nodes.push(node)\n      })\n      return $(nodes)\n    },\n    parents: function(selector){\n      var ancestors = [], nodes = this\n      while (nodes.length > 0)\n        nodes = $.map(nodes, function(node){\n          if ((node = node.parentNode) && !isDocument(node) && ancestors.indexOf(node) < 0) {\n            ancestors.push(node)\n            return node\n          }\n        })\n      return filtered(ancestors, selector)\n    },\n    parent: function(selector){\n      return filtered(uniq(this.pluck('parentNode')), selector)\n    },\n    children: function(selector){\n      return filtered(this.map(function(){ return children(this) }), selector)\n    },\n    contents: function() {\n      return this.map(function() { return this.contentDocument || slice.call(this.childNodes) })\n    },\n    siblings: function(selector){\n      return filtered(this.map(function(i, el){\n        return filter.call(children(el.parentNode), function(child){ return child!==el })\n      }), selector)\n    },\n    empty: function(){\n      return this.each(function(){ this.innerHTML = '' })\n    },\n    // `pluck` is borrowed from Prototype.js\n    pluck: function(property){\n      return $.map(this, function(el){ return el[property] })\n    },\n    show: function(){\n      return this.each(function(){\n        this.style.display == \"none\" && (this.style.display = '')\n        if (getComputedStyle(this, '').getPropertyValue(\"display\") == \"none\")\n          this.style.display = defaultDisplay(this.nodeName)\n      })\n    },\n    replaceWith: function(newContent){\n      return this.before(newContent).remove()\n    },\n    wrap: function(structure){\n      var func = isFunction(structure)\n      if (this[0] && !func)\n        var dom   = $(structure).get(0),\n            clone = dom.parentNode || this.length > 1\n\n      return this.each(function(index){\n        $(this).wrapAll(\n          func ? structure.call(this, index) :\n            clone ? dom.cloneNode(true) : dom\n        )\n      })\n    },\n    wrapAll: function(structure){\n      if (this[0]) {\n        $(this[0]).before(structure = $(structure))\n        var children\n        // drill down to the inmost element\n        while ((children = structure.children()).length) structure = children.first()\n        $(structure).append(this)\n      }\n      return this\n    },\n    wrapInner: function(structure){\n      var func = isFunction(structure)\n      return this.each(function(index){\n        var self = $(this), contents = self.contents(),\n            dom  = func ? structure.call(this, index) : structure\n        contents.length ? contents.wrapAll(dom) : self.append(dom)\n      })\n    },\n    unwrap: function(){\n      this.parent().each(function(){\n        $(this).replaceWith($(this).children())\n      })\n      return this\n    },\n    clone: function(){\n      return this.map(function(){ return this.cloneNode(true) })\n    },\n    hide: function(){\n      return this.css(\"display\", \"none\")\n    },\n    toggle: function(setting){\n      return this.each(function(){\n        var el = $(this)\n        ;(setting === undefined ? el.css(\"display\") == \"none\" : setting) ? el.show() : el.hide()\n      })\n    },\n    prev: function(selector){ return $(this.pluck('previousElementSibling')).filter(selector || '*') },\n    next: function(selector){ return $(this.pluck('nextElementSibling')).filter(selector || '*') },\n    html: function(html){\n      return 0 in arguments ?\n        this.each(function(idx){\n          var originHtml = this.innerHTML\n          $(this).empty().append( funcArg(this, html, idx, originHtml) )\n        }) :\n        (0 in this ? this[0].innerHTML : null)\n    },\n    text: function(text){\n      return 0 in arguments ?\n        this.each(function(idx){\n          var newText = funcArg(this, text, idx, this.textContent)\n          this.textContent = newText == null ? '' : ''+newText\n        }) :\n        (0 in this ? this.pluck('textContent').join(\"\") : null)\n    },\n    attr: function(name, value){\n      var result\n      return (typeof name == 'string' && !(1 in arguments)) ?\n        (0 in this && this[0].nodeType == 1 && (result = this[0].getAttribute(name)) != null ? result : undefined) :\n        this.each(function(idx){\n          if (this.nodeType !== 1) return\n          if (isObject(name)) for (key in name) setAttribute(this, key, name[key])\n          else setAttribute(this, name, funcArg(this, value, idx, this.getAttribute(name)))\n        })\n    },\n    removeAttr: function(name){\n      return this.each(function(){ this.nodeType === 1 && name.split(' ').forEach(function(attribute){\n        setAttribute(this, attribute)\n      }, this)})\n    },\n    prop: function(name, value){\n      name = propMap[name] || name\n      return (1 in arguments) ?\n        this.each(function(idx){\n          this[name] = funcArg(this, value, idx, this[name])\n        }) :\n        (this[0] && this[0][name])\n    },\n    removeProp: function(name){\n      name = propMap[name] || name\n      return this.each(function(){ delete this[name] })\n    },\n    data: function(name, value){\n      var attrName = 'data-' + name.replace(capitalRE, '-$1').toLowerCase()\n\n      var data = (1 in arguments) ?\n        this.attr(attrName, value) :\n        this.attr(attrName)\n\n      return data !== null ? deserializeValue(data) : undefined\n    },\n    val: function(value){\n      if (0 in arguments) {\n        if (value == null) value = \"\"\n        return this.each(function(idx){\n          this.value = funcArg(this, value, idx, this.value)\n        })\n      } else {\n        return this[0] && (this[0].multiple ?\n           $(this[0]).find('option').filter(function(){ return this.selected }).pluck('value') :\n           this[0].value)\n      }\n    },\n    offset: function(coordinates){\n      if (coordinates) return this.each(function(index){\n        var $this = $(this),\n            coords = funcArg(this, coordinates, index, $this.offset()),\n            parentOffset = $this.offsetParent().offset(),\n            props = {\n              top:  coords.top  - parentOffset.top,\n              left: coords.left - parentOffset.left\n            }\n\n        if ($this.css('position') == 'static') props['position'] = 'relative'\n        $this.css(props)\n      })\n      if (!this.length) return null\n      if (document.documentElement !== this[0] && !$.contains(document.documentElement, this[0]))\n        return {top: 0, left: 0}\n      var obj = this[0].getBoundingClientRect()\n      return {\n        left: obj.left + window.pageXOffset,\n        top: obj.top + window.pageYOffset,\n        width: Math.round(obj.width),\n        height: Math.round(obj.height)\n      }\n    },\n    css: function(property, value){\n      if (arguments.length < 2) {\n        var element = this[0]\n        if (typeof property == 'string') {\n          if (!element) return\n          return element.style[camelize(property)] || getComputedStyle(element, '').getPropertyValue(property)\n        } else if (isArray(property)) {\n          if (!element) return\n          var props = {}\n          var computedStyle = getComputedStyle(element, '')\n          $.each(property, function(_, prop){\n            props[prop] = (element.style[camelize(prop)] || computedStyle.getPropertyValue(prop))\n          })\n          return props\n        }\n      }\n\n      var css = ''\n      if (type(property) == 'string') {\n        if (!value && value !== 0)\n          this.each(function(){ this.style.removeProperty(dasherize(property)) })\n        else\n          css = dasherize(property) + \":\" + maybeAddPx(property, value)\n      } else {\n        for (key in property)\n          if (!property[key] && property[key] !== 0)\n            this.each(function(){ this.style.removeProperty(dasherize(key)) })\n          else\n            css += dasherize(key) + ':' + maybeAddPx(key, property[key]) + ';'\n      }\n\n      return this.each(function(){ this.style.cssText += ';' + css })\n    },\n    index: function(element){\n      return element ? this.indexOf($(element)[0]) : this.parent().children().indexOf(this[0])\n    },\n    hasClass: function(name){\n      if (!name) return false\n      return emptyArray.some.call(this, function(el){\n        return this.test(className(el))\n      }, classRE(name))\n    },\n    addClass: function(name){\n      if (!name) return this\n      return this.each(function(idx){\n        if (!('className' in this)) return\n        classList = []\n        var cls = className(this), newName = funcArg(this, name, idx, cls)\n        newName.split(/\\s+/g).forEach(function(klass){\n          if (!$(this).hasClass(klass)) classList.push(klass)\n        }, this)\n        classList.length && className(this, cls + (cls ? \" \" : \"\") + classList.join(\" \"))\n      })\n    },\n    removeClass: function(name){\n      return this.each(function(idx){\n        if (!('className' in this)) return\n        if (name === undefined) return className(this, '')\n        classList = className(this)\n        funcArg(this, name, idx, classList).split(/\\s+/g).forEach(function(klass){\n          classList = classList.replace(classRE(klass), \" \")\n        })\n        className(this, classList.trim())\n      })\n    },\n    toggleClass: function(name, when){\n      if (!name) return this\n      return this.each(function(idx){\n        var $this = $(this), names = funcArg(this, name, idx, className(this))\n        names.split(/\\s+/g).forEach(function(klass){\n          (when === undefined ? !$this.hasClass(klass) : when) ?\n            $this.addClass(klass) : $this.removeClass(klass)\n        })\n      })\n    },\n    scrollTop: function(value){\n      if (!this.length) return\n      var hasScrollTop = 'scrollTop' in this[0]\n      if (value === undefined) return hasScrollTop ? this[0].scrollTop : this[0].pageYOffset\n      return this.each(hasScrollTop ?\n        function(){ this.scrollTop = value } :\n        function(){ this.scrollTo(this.scrollX, value) })\n    },\n    scrollLeft: function(value){\n      if (!this.length) return\n      var hasScrollLeft = 'scrollLeft' in this[0]\n      if (value === undefined) return hasScrollLeft ? this[0].scrollLeft : this[0].pageXOffset\n      return this.each(hasScrollLeft ?\n        function(){ this.scrollLeft = value } :\n        function(){ this.scrollTo(value, this.scrollY) })\n    },\n    position: function() {\n      if (!this.length) return\n\n      var elem = this[0],\n        // Get *real* offsetParent\n        offsetParent = this.offsetParent(),\n        // Get correct offsets\n        offset       = this.offset(),\n        parentOffset = rootNodeRE.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset()\n\n      // Subtract element margins\n      // note: when an element has margin: auto the offsetLeft and marginLeft\n      // are the same in Safari causing offset.left to incorrectly be 0\n      offset.top  -= parseFloat( $(elem).css('margin-top') ) || 0\n      offset.left -= parseFloat( $(elem).css('margin-left') ) || 0\n\n      // Add offsetParent borders\n      parentOffset.top  += parseFloat( $(offsetParent[0]).css('border-top-width') ) || 0\n      parentOffset.left += parseFloat( $(offsetParent[0]).css('border-left-width') ) || 0\n\n      // Subtract the two offsets\n      return {\n        top:  offset.top  - parentOffset.top,\n        left: offset.left - parentOffset.left\n      }\n    },\n    offsetParent: function() {\n      return this.map(function(){\n        var parent = this.offsetParent || document.body\n        while (parent && !rootNodeRE.test(parent.nodeName) && $(parent).css(\"position\") == \"static\")\n          parent = parent.offsetParent\n        return parent\n      })\n    }\n  }\n\n  // for now\n  $.fn.detach = $.fn.remove\n\n  // Generate the `width` and `height` functions\n  ;['width', 'height'].forEach(function(dimension){\n    var dimensionProperty =\n      dimension.replace(/./, function(m){ return m[0].toUpperCase() })\n\n    $.fn[dimension] = function(value){\n      var offset, el = this[0]\n      if (value === undefined) return isWindow(el) ? el['inner' + dimensionProperty] :\n        isDocument(el) ? el.documentElement['scroll' + dimensionProperty] :\n        (offset = this.offset()) && offset[dimension]\n      else return this.each(function(idx){\n        el = $(this)\n        el.css(dimension, funcArg(this, value, idx, el[dimension]()))\n      })\n    }\n  })\n\n  function traverseNode(node, fun) {\n    fun(node)\n    for (var i = 0, len = node.childNodes.length; i < len; i++)\n      traverseNode(node.childNodes[i], fun)\n  }\n\n  // Generate the `after`, `prepend`, `before`, `append`,\n  // `insertAfter`, `insertBefore`, `appendTo`, and `prependTo` methods.\n  adjacencyOperators.forEach(function(operator, operatorIndex) {\n    var inside = operatorIndex % 2 //=> prepend, append\n\n    $.fn[operator] = function(){\n      // arguments can be nodes, arrays of nodes, Zepto objects and HTML strings\n      var argType, nodes = $.map(arguments, function(arg) {\n            var arr = []\n            argType = type(arg)\n            if (argType == \"array\") {\n              arg.forEach(function(el) {\n                if (el.nodeType !== undefined) return arr.push(el)\n                else if ($.zepto.isZ(el)) return arr = arr.concat(el.get())\n                arr = arr.concat(zepto.fragment(el))\n              })\n              return arr\n            }\n            return argType == \"object\" || arg == null ?\n              arg : zepto.fragment(arg)\n          }),\n          parent, copyByClone = this.length > 1\n      if (nodes.length < 1) return this\n\n      return this.each(function(_, target){\n        parent = inside ? target : target.parentNode\n\n        // convert all methods to a \"before\" operation\n        target = operatorIndex == 0 ? target.nextSibling :\n                 operatorIndex == 1 ? target.firstChild :\n                 operatorIndex == 2 ? target :\n                 null\n\n        var parentInDocument = $.contains(document.documentElement, parent)\n\n        nodes.forEach(function(node){\n          if (copyByClone) node = node.cloneNode(true)\n          else if (!parent) return $(node).remove()\n\n          parent.insertBefore(node, target)\n          if (parentInDocument) traverseNode(node, function(el){\n            if (el.nodeName != null && el.nodeName.toUpperCase() === 'SCRIPT' &&\n               (!el.type || el.type === 'text/javascript') && !el.src){\n              var target = el.ownerDocument ? el.ownerDocument.defaultView : window\n              target['eval'].call(target, el.innerHTML)\n            }\n          })\n        })\n      })\n    }\n\n    // after    => insertAfter\n    // prepend  => prependTo\n    // before   => insertBefore\n    // append   => appendTo\n    $.fn[inside ? operator+'To' : 'insert'+(operatorIndex ? 'Before' : 'After')] = function(html){\n      $(html)[operator](this)\n      return this\n    }\n  })\n\n  zepto.Z.prototype = Z.prototype = $.fn\n\n  // Export internal API functions in the `$.zepto` namespace\n  zepto.uniq = uniq\n  zepto.deserializeValue = deserializeValue\n  $.zepto = zepto\n\n  return $\n})()\n\nwindow.Zepto = Zepto\nwindow.$ === undefined && (window.$ = Zepto)\n\n;(function($){\n  var _zid = 1, undefined,\n      slice = Array.prototype.slice,\n      isFunction = $.isFunction,\n      isString = function(obj){ return typeof obj == 'string' },\n      handlers = {},\n      specialEvents={},\n      focusinSupported = 'onfocusin' in window,\n      focus = { focus: 'focusin', blur: 'focusout' },\n      hover = { mouseenter: 'mouseover', mouseleave: 'mouseout' }\n\n  specialEvents.click = specialEvents.mousedown = specialEvents.mouseup = specialEvents.mousemove = 'MouseEvents'\n\n  function zid(element) {\n    return element._zid || (element._zid = _zid++)\n  }\n  function findHandlers(element, event, fn, selector) {\n    event = parse(event)\n    if (event.ns) var matcher = matcherFor(event.ns)\n    return (handlers[zid(element)] || []).filter(function(handler) {\n      return handler\n        && (!event.e  || handler.e == event.e)\n        && (!event.ns || matcher.test(handler.ns))\n        && (!fn       || zid(handler.fn) === zid(fn))\n        && (!selector || handler.sel == selector)\n    })\n  }\n  function parse(event) {\n    var parts = ('' + event).split('.')\n    return {e: parts[0], ns: parts.slice(1).sort().join(' ')}\n  }\n  function matcherFor(ns) {\n    return new RegExp('(?:^| )' + ns.replace(' ', ' .* ?') + '(?: |$)')\n  }\n\n  function eventCapture(handler, captureSetting) {\n    return handler.del &&\n      (!focusinSupported && (handler.e in focus)) ||\n      !!captureSetting\n  }\n\n  function realEvent(type) {\n    return hover[type] || (focusinSupported && focus[type]) || type\n  }\n\n  function add(element, events, fn, data, selector, delegator, capture){\n    var id = zid(element), set = (handlers[id] || (handlers[id] = []))\n    events.split(/\\s/).forEach(function(event){\n      if (event == 'ready') return $(document).ready(fn)\n      var handler   = parse(event)\n      handler.fn    = fn\n      handler.sel   = selector\n      // emulate mouseenter, mouseleave\n      if (handler.e in hover) fn = function(e){\n        var related = e.relatedTarget\n        if (!related || (related !== this && !$.contains(this, related)))\n          return handler.fn.apply(this, arguments)\n      }\n      handler.del   = delegator\n      var callback  = delegator || fn\n      handler.proxy = function(e){\n        e = compatible(e)\n        if (e.isImmediatePropagationStopped()) return\n        e.data = data\n        var result = callback.apply(element, e._args == undefined ? [e] : [e].concat(e._args))\n        if (result === false) e.preventDefault(), e.stopPropagation()\n        return result\n      }\n      handler.i = set.length\n      set.push(handler)\n      if ('addEventListener' in element)\n        element.addEventListener(realEvent(handler.e), handler.proxy, eventCapture(handler, capture))\n    })\n  }\n  function remove(element, events, fn, selector, capture){\n    var id = zid(element)\n    ;(events || '').split(/\\s/).forEach(function(event){\n      findHandlers(element, event, fn, selector).forEach(function(handler){\n        delete handlers[id][handler.i]\n      if ('removeEventListener' in element)\n        element.removeEventListener(realEvent(handler.e), handler.proxy, eventCapture(handler, capture))\n      })\n    })\n  }\n\n  $.event = { add: add, remove: remove }\n\n  $.proxy = function(fn, context) {\n    var args = (2 in arguments) && slice.call(arguments, 2)\n    if (isFunction(fn)) {\n      var proxyFn = function(){ return fn.apply(context, args ? args.concat(slice.call(arguments)) : arguments) }\n      proxyFn._zid = zid(fn)\n      return proxyFn\n    } else if (isString(context)) {\n      if (args) {\n        args.unshift(fn[context], fn)\n        return $.proxy.apply(null, args)\n      } else {\n        return $.proxy(fn[context], fn)\n      }\n    } else {\n      throw new TypeError(\"expected function\")\n    }\n  }\n\n  $.fn.bind = function(event, data, callback){\n    return this.on(event, data, callback)\n  }\n  $.fn.unbind = function(event, callback){\n    return this.off(event, callback)\n  }\n  $.fn.one = function(event, selector, data, callback){\n    return this.on(event, selector, data, callback, 1)\n  }\n\n  var returnTrue = function(){return true},\n      returnFalse = function(){return false},\n      ignoreProperties = /^([A-Z]|returnValue$|layer[XY]$|webkitMovement[XY]$)/,\n      eventMethods = {\n        preventDefault: 'isDefaultPrevented',\n        stopImmediatePropagation: 'isImmediatePropagationStopped',\n        stopPropagation: 'isPropagationStopped'\n      }\n\n  function compatible(event, source) {\n    if (source || !event.isDefaultPrevented) {\n      source || (source = event)\n\n      $.each(eventMethods, function(name, predicate) {\n        var sourceMethod = source[name]\n        event[name] = function(){\n          this[predicate] = returnTrue\n          return sourceMethod && sourceMethod.apply(source, arguments)\n        }\n        event[predicate] = returnFalse\n      })\n\n      event.timeStamp || (event.timeStamp = Date.now())\n\n      if (source.defaultPrevented !== undefined ? source.defaultPrevented :\n          'returnValue' in source ? source.returnValue === false :\n          source.getPreventDefault && source.getPreventDefault())\n        event.isDefaultPrevented = returnTrue\n    }\n    return event\n  }\n\n  function createProxy(event) {\n    var key, proxy = { originalEvent: event }\n    for (key in event)\n      if (!ignoreProperties.test(key) && event[key] !== undefined) proxy[key] = event[key]\n\n    return compatible(proxy, event)\n  }\n\n  $.fn.delegate = function(selector, event, callback){\n    return this.on(event, selector, callback)\n  }\n  $.fn.undelegate = function(selector, event, callback){\n    return this.off(event, selector, callback)\n  }\n\n  $.fn.live = function(event, callback){\n    $(document.body).delegate(this.selector, event, callback)\n    return this\n  }\n  $.fn.die = function(event, callback){\n    $(document.body).undelegate(this.selector, event, callback)\n    return this\n  }\n\n  $.fn.on = function(event, selector, data, callback, one){\n    var autoRemove, delegator, $this = this\n    if (event && !isString(event)) {\n      $.each(event, function(type, fn){\n        $this.on(type, selector, data, fn, one)\n      })\n      return $this\n    }\n\n    if (!isString(selector) && !isFunction(callback) && callback !== false)\n      callback = data, data = selector, selector = undefined\n    if (callback === undefined || data === false)\n      callback = data, data = undefined\n\n    if (callback === false) callback = returnFalse\n\n    return $this.each(function(_, element){\n      if (one) autoRemove = function(e){\n        remove(element, e.type, callback)\n        return callback.apply(this, arguments)\n      }\n\n      if (selector) delegator = function(e){\n        var evt, match = $(e.target).closest(selector, element).get(0)\n        if (match && match !== element) {\n          evt = $.extend(createProxy(e), {currentTarget: match, liveFired: element})\n          return (autoRemove || callback).apply(match, [evt].concat(slice.call(arguments, 1)))\n        }\n      }\n\n      add(element, event, callback, data, selector, delegator || autoRemove)\n    })\n  }\n  $.fn.off = function(event, selector, callback){\n    var $this = this\n    if (event && !isString(event)) {\n      $.each(event, function(type, fn){\n        $this.off(type, selector, fn)\n      })\n      return $this\n    }\n\n    if (!isString(selector) && !isFunction(callback) && callback !== false)\n      callback = selector, selector = undefined\n\n    if (callback === false) callback = returnFalse\n\n    return $this.each(function(){\n      remove(this, event, callback, selector)\n    })\n  }\n\n  $.fn.trigger = function(event, args){\n    event = (isString(event) || $.isPlainObject(event)) ? $.Event(event) : compatible(event)\n    event._args = args\n    return this.each(function(){\n      // handle focus(), blur() by calling them directly\n      if (event.type in focus && typeof this[event.type] == \"function\") this[event.type]()\n      // items in the collection might not be DOM elements\n      else if ('dispatchEvent' in this) this.dispatchEvent(event)\n      else $(this).triggerHandler(event, args)\n    })\n  }\n\n  // triggers event handlers on current element just as if an event occurred,\n  // doesn't trigger an actual event, doesn't bubble\n  $.fn.triggerHandler = function(event, args){\n    var e, result\n    this.each(function(i, element){\n      e = createProxy(isString(event) ? $.Event(event) : event)\n      e._args = args\n      e.target = element\n      $.each(findHandlers(element, event.type || event), function(i, handler){\n        result = handler.proxy(e)\n        if (e.isImmediatePropagationStopped()) return false\n      })\n    })\n    return result\n  }\n\n  // shortcut methods for `.bind(event, fn)` for each event type\n  ;('focusin focusout focus blur load resize scroll unload click dblclick '+\n  'mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave '+\n  'change select keydown keypress keyup error').split(' ').forEach(function(event) {\n    $.fn[event] = function(callback) {\n      return (0 in arguments) ?\n        this.bind(event, callback) :\n        this.trigger(event)\n    }\n  })\n\n  $.Event = function(type, props) {\n    if (!isString(type)) props = type, type = props.type\n    var event = document.createEvent(specialEvents[type] || 'Events'), bubbles = true\n    if (props) for (var name in props) (name == 'bubbles') ? (bubbles = !!props[name]) : (event[name] = props[name])\n    event.initEvent(type, bubbles, true)\n    return compatible(event)\n  }\n\n})(Zepto)\n\n;(function($){\n  var jsonpID = +new Date(),\n      document = window.document,\n      key,\n      name,\n      rscript = /<script\\b[^<]*(?:(?!<\\/script>)<[^<]*)*<\\/script>/gi,\n      scriptTypeRE = /^(?:text|application)\\/javascript/i,\n      xmlTypeRE = /^(?:text|application)\\/xml/i,\n      jsonType = 'application/json',\n      htmlType = 'text/html',\n      blankRE = /^\\s*$/,\n      originAnchor = document.createElement('a')\n\n  originAnchor.href = window.location.href\n\n  // trigger a custom event and return false if it was cancelled\n  function triggerAndReturn(context, eventName, data) {\n    var event = $.Event(eventName)\n    $(context).trigger(event, data)\n    return !event.isDefaultPrevented()\n  }\n\n  // trigger an Ajax \"global\" event\n  function triggerGlobal(settings, context, eventName, data) {\n    if (settings.global) return triggerAndReturn(context || document, eventName, data)\n  }\n\n  // Number of active Ajax requests\n  $.active = 0\n\n  function ajaxStart(settings) {\n    if (settings.global && $.active++ === 0) triggerGlobal(settings, null, 'ajaxStart')\n  }\n  function ajaxStop(settings) {\n    if (settings.global && !(--$.active)) triggerGlobal(settings, null, 'ajaxStop')\n  }\n\n  // triggers an extra global event \"ajaxBeforeSend\" that's like \"ajaxSend\" but cancelable\n  function ajaxBeforeSend(xhr, settings) {\n    var context = settings.context\n    if (settings.beforeSend.call(context, xhr, settings) === false ||\n        triggerGlobal(settings, context, 'ajaxBeforeSend', [xhr, settings]) === false)\n      return false\n\n    triggerGlobal(settings, context, 'ajaxSend', [xhr, settings])\n  }\n  function ajaxSuccess(data, xhr, settings, deferred) {\n    var context = settings.context, status = 'success'\n    settings.success.call(context, data, status, xhr)\n    if (deferred) deferred.resolveWith(context, [data, status, xhr])\n    triggerGlobal(settings, context, 'ajaxSuccess', [xhr, settings, data])\n    ajaxComplete(status, xhr, settings)\n  }\n  // type: \"timeout\", \"error\", \"abort\", \"parsererror\"\n  function ajaxError(error, type, xhr, settings, deferred) {\n    var context = settings.context\n    settings.error.call(context, xhr, type, error)\n    if (deferred) deferred.rejectWith(context, [xhr, type, error])\n    triggerGlobal(settings, context, 'ajaxError', [xhr, settings, error || type])\n    ajaxComplete(type, xhr, settings)\n  }\n  // status: \"success\", \"notmodified\", \"error\", \"timeout\", \"abort\", \"parsererror\"\n  function ajaxComplete(status, xhr, settings) {\n    var context = settings.context\n    settings.complete.call(context, xhr, status)\n    triggerGlobal(settings, context, 'ajaxComplete', [xhr, settings])\n    ajaxStop(settings)\n  }\n\n  function ajaxDataFilter(data, type, settings) {\n    if (settings.dataFilter == empty) return data\n    var context = settings.context\n    return settings.dataFilter.call(context, data, type)\n  }\n\n  // Empty function, used as default callback\n  function empty() {}\n\n  $.ajaxJSONP = function(options, deferred){\n    if (!('type' in options)) return $.ajax(options)\n\n    var _callbackName = options.jsonpCallback,\n      callbackName = ($.isFunction(_callbackName) ?\n        _callbackName() : _callbackName) || ('Zepto' + (jsonpID++)),\n      script = document.createElement('script'),\n      originalCallback = window[callbackName],\n      responseData,\n      abort = function(errorType) {\n        $(script).triggerHandler('error', errorType || 'abort')\n      },\n      xhr = { abort: abort }, abortTimeout\n\n    if (deferred) deferred.promise(xhr)\n\n    $(script).on('load error', function(e, errorType){\n      clearTimeout(abortTimeout)\n      $(script).off().remove()\n\n      if (e.type == 'error' || !responseData) {\n        ajaxError(null, errorType || 'error', xhr, options, deferred)\n      } else {\n        ajaxSuccess(responseData[0], xhr, options, deferred)\n      }\n\n      window[callbackName] = originalCallback\n      if (responseData && $.isFunction(originalCallback))\n        originalCallback(responseData[0])\n\n      originalCallback = responseData = undefined\n    })\n\n    if (ajaxBeforeSend(xhr, options) === false) {\n      abort('abort')\n      return xhr\n    }\n\n    window[callbackName] = function(){\n      responseData = arguments\n    }\n\n    script.src = options.url.replace(/\\?(.+)=\\?/, '?$1=' + callbackName)\n    document.head.appendChild(script)\n\n    if (options.timeout > 0) abortTimeout = setTimeout(function(){\n      abort('timeout')\n    }, options.timeout)\n\n    return xhr\n  }\n\n  $.ajaxSettings = {\n    // Default type of request\n    type: 'GET',\n    // Callback that is executed before request\n    beforeSend: empty,\n    // Callback that is executed if the request succeeds\n    success: empty,\n    // Callback that is executed the the server drops error\n    error: empty,\n    // Callback that is executed on request complete (both: error and success)\n    complete: empty,\n    // The context for the callbacks\n    context: null,\n    // Whether to trigger \"global\" Ajax events\n    global: true,\n    // Transport\n    xhr: function () {\n      return new window.XMLHttpRequest()\n    },\n    // MIME types mapping\n    // IIS returns Javascript as \"application/x-javascript\"\n    accepts: {\n      script: 'text/javascript, application/javascript, application/x-javascript',\n      json:   jsonType,\n      xml:    'application/xml, text/xml',\n      html:   htmlType,\n      text:   'text/plain'\n    },\n    // Whether the request is to another domain\n    crossDomain: false,\n    // Default timeout\n    timeout: 0,\n    // Whether data should be serialized to string\n    processData: true,\n    // Whether the browser should be allowed to cache GET responses\n    cache: true,\n    //Used to handle the raw response data of XMLHttpRequest.\n    //This is a pre-filtering function to sanitize the response.\n    //The sanitized response should be returned\n    dataFilter: empty\n  }\n\n  function mimeToDataType(mime) {\n    if (mime) mime = mime.split(';', 2)[0]\n    return mime && ( mime == htmlType ? 'html' :\n      mime == jsonType ? 'json' :\n      scriptTypeRE.test(mime) ? 'script' :\n      xmlTypeRE.test(mime) && 'xml' ) || 'text'\n  }\n\n  function appendQuery(url, query) {\n    if (query == '') return url\n    return (url + '&' + query).replace(/[&?]{1,2}/, '?')\n  }\n\n  // serialize payload and append it to the URL for GET requests\n  function serializeData(options) {\n    if (options.processData && options.data && $.type(options.data) != \"string\")\n      options.data = $.param(options.data, options.traditional)\n    if (options.data && (!options.type || options.type.toUpperCase() == 'GET' || 'jsonp' == options.dataType))\n      options.url = appendQuery(options.url, options.data), options.data = undefined\n  }\n\n  $.ajax = function(options){\n    var settings = $.extend({}, options || {}),\n        deferred = $.Deferred && $.Deferred(),\n        urlAnchor, hashIndex\n    for (key in $.ajaxSettings) if (settings[key] === undefined) settings[key] = $.ajaxSettings[key]\n\n    ajaxStart(settings)\n\n    if (!settings.crossDomain) {\n      urlAnchor = document.createElement('a')\n      urlAnchor.href = settings.url\n      // cleans up URL for .href (IE only), see https://github.com/madrobby/zepto/pull/1049\n      urlAnchor.href = urlAnchor.href\n      settings.crossDomain = (originAnchor.protocol + '//' + originAnchor.host) !== (urlAnchor.protocol + '//' + urlAnchor.host)\n    }\n\n    if (!settings.url) settings.url = window.location.toString()\n    if ((hashIndex = settings.url.indexOf('#')) > -1) settings.url = settings.url.slice(0, hashIndex)\n    serializeData(settings)\n\n    var dataType = settings.dataType, hasPlaceholder = /\\?.+=\\?/.test(settings.url)\n    if (hasPlaceholder) dataType = 'jsonp'\n\n    if (settings.cache === false || (\n         (!options || options.cache !== true) &&\n         ('script' == dataType || 'jsonp' == dataType)\n        ))\n      settings.url = appendQuery(settings.url, '_=' + Date.now())\n\n    if ('jsonp' == dataType) {\n      if (!hasPlaceholder)\n        settings.url = appendQuery(settings.url,\n          settings.jsonp ? (settings.jsonp + '=?') : settings.jsonp === false ? '' : 'callback=?')\n      return $.ajaxJSONP(settings, deferred)\n    }\n\n    var mime = settings.accepts[dataType],\n        headers = { },\n        setHeader = function(name, value) { headers[name.toLowerCase()] = [name, value] },\n        protocol = /^([\\w-]+:)\\/\\//.test(settings.url) ? RegExp.$1 : window.location.protocol,\n        xhr = settings.xhr(),\n        nativeSetHeader = xhr.setRequestHeader,\n        abortTimeout\n\n    if (deferred) deferred.promise(xhr)\n\n    if (!settings.crossDomain) setHeader('X-Requested-With', 'XMLHttpRequest')\n    setHeader('Accept', mime || '*/*')\n    if (mime = settings.mimeType || mime) {\n      if (mime.indexOf(',') > -1) mime = mime.split(',', 2)[0]\n      xhr.overrideMimeType && xhr.overrideMimeType(mime)\n    }\n    if (settings.contentType || (settings.contentType !== false && settings.data && settings.type.toUpperCase() != 'GET'))\n      setHeader('Content-Type', settings.contentType || 'application/x-www-form-urlencoded')\n\n    if (settings.headers) for (name in settings.headers) setHeader(name, settings.headers[name])\n    xhr.setRequestHeader = setHeader\n\n    xhr.onreadystatechange = function(){\n      if (xhr.readyState == 4) {\n        xhr.onreadystatechange = empty\n        clearTimeout(abortTimeout)\n        var result, error = false\n        if ((xhr.status >= 200 && xhr.status < 300) || xhr.status == 304 || (xhr.status == 0 && protocol == 'file:')) {\n          dataType = dataType || mimeToDataType(settings.mimeType || xhr.getResponseHeader('content-type'))\n\n          if (xhr.responseType == 'arraybuffer' || xhr.responseType == 'blob')\n            result = xhr.response\n          else {\n            result = xhr.responseText\n\n            try {\n              // http://perfectionkills.com/global-eval-what-are-the-options/\n              // sanitize response accordingly if data filter callback provided\n              result = ajaxDataFilter(result, dataType, settings)\n              if (dataType == 'script')    (1,eval)(result)\n              else if (dataType == 'xml')  result = xhr.responseXML\n              else if (dataType == 'json') result = blankRE.test(result) ? null : $.parseJSON(result)\n            } catch (e) { error = e }\n\n            if (error) return ajaxError(error, 'parsererror', xhr, settings, deferred)\n          }\n\n          ajaxSuccess(result, xhr, settings, deferred)\n        } else {\n          ajaxError(xhr.statusText || null, xhr.status ? 'error' : 'abort', xhr, settings, deferred)\n        }\n      }\n    }\n\n    if (ajaxBeforeSend(xhr, settings) === false) {\n      xhr.abort()\n      ajaxError(null, 'abort', xhr, settings, deferred)\n      return xhr\n    }\n\n    var async = 'async' in settings ? settings.async : true\n    xhr.open(settings.type, settings.url, async, settings.username, settings.password)\n\n    if (settings.xhrFields) for (name in settings.xhrFields) xhr[name] = settings.xhrFields[name]\n\n    for (name in headers) nativeSetHeader.apply(xhr, headers[name])\n\n    if (settings.timeout > 0) abortTimeout = setTimeout(function(){\n        xhr.onreadystatechange = empty\n        xhr.abort()\n        ajaxError(null, 'timeout', xhr, settings, deferred)\n      }, settings.timeout)\n\n    // avoid sending empty string (#319)\n    xhr.send(settings.data ? settings.data : null)\n    return xhr\n  }\n\n  // handle optional data/success arguments\n  function parseArguments(url, data, success, dataType) {\n    if ($.isFunction(data)) dataType = success, success = data, data = undefined\n    if (!$.isFunction(success)) dataType = success, success = undefined\n    return {\n      url: url\n    , data: data\n    , success: success\n    , dataType: dataType\n    }\n  }\n\n  $.get = function(/* url, data, success, dataType */){\n    return $.ajax(parseArguments.apply(null, arguments))\n  }\n\n  $.post = function(/* url, data, success, dataType */){\n    var options = parseArguments.apply(null, arguments)\n    options.type = 'POST'\n    return $.ajax(options)\n  }\n\n  $.getJSON = function(/* url, data, success */){\n    var options = parseArguments.apply(null, arguments)\n    options.dataType = 'json'\n    return $.ajax(options)\n  }\n\n  $.fn.load = function(url, data, success){\n    if (!this.length) return this\n    var self = this, parts = url.split(/\\s/), selector,\n        options = parseArguments(url, data, success),\n        callback = options.success\n    if (parts.length > 1) options.url = parts[0], selector = parts[1]\n    options.success = function(response){\n      self.html(selector ?\n        $('<div>').html(response.replace(rscript, \"\")).find(selector)\n        : response)\n      callback && callback.apply(self, arguments)\n    }\n    $.ajax(options)\n    return this\n  }\n\n  var escape = encodeURIComponent\n\n  function serialize(params, obj, traditional, scope){\n    var type, array = $.isArray(obj), hash = $.isPlainObject(obj)\n    $.each(obj, function(key, value) {\n      type = $.type(value)\n      if (scope) key = traditional ? scope :\n        scope + '[' + (hash || type == 'object' || type == 'array' ? key : '') + ']'\n      // handle data in serializeArray() format\n      if (!scope && array) params.add(value.name, value.value)\n      // recurse into nested objects\n      else if (type == \"array\" || (!traditional && type == \"object\"))\n        serialize(params, value, traditional, key)\n      else params.add(key, value)\n    })\n  }\n\n  $.param = function(obj, traditional){\n    var params = []\n    params.add = function(key, value) {\n      if ($.isFunction(value)) value = value()\n      if (value == null) value = \"\"\n      this.push(escape(key) + '=' + escape(value))\n    }\n    serialize(params, obj, traditional)\n    return params.join('&').replace(/%20/g, '+')\n  }\n})(Zepto)\n\n;(function($){\n  $.fn.serializeArray = function() {\n    var name, type, result = [],\n      add = function(value) {\n        if (value.forEach) return value.forEach(add)\n        result.push({ name: name, value: value })\n      }\n    if (this[0]) $.each(this[0].elements, function(_, field){\n      type = field.type, name = field.name\n      if (name && field.nodeName.toLowerCase() != 'fieldset' &&\n        !field.disabled && type != 'submit' && type != 'reset' && type != 'button' && type != 'file' &&\n        ((type != 'radio' && type != 'checkbox') || field.checked))\n          add($(field).val())\n    })\n    return result\n  }\n\n  $.fn.serialize = function(){\n    var result = []\n    this.serializeArray().forEach(function(elm){\n      result.push(encodeURIComponent(elm.name) + '=' + encodeURIComponent(elm.value))\n    })\n    return result.join('&')\n  }\n\n  $.fn.submit = function(callback) {\n    if (0 in arguments) this.bind('submit', callback)\n    else if (this.length) {\n      var event = $.Event('submit')\n      this.eq(0).trigger(event)\n      if (!event.isDefaultPrevented()) this.get(0).submit()\n    }\n    return this\n  }\n\n})(Zepto)\n\n;(function(){\n  // getComputedStyle shouldn't freak out when called\n  // without a valid element as argument\n  try {\n    getComputedStyle(undefined)\n  } catch(e) {\n    var nativeGetComputedStyle = getComputedStyle\n    window.getComputedStyle = function(element, pseudoElement){\n      try {\n        return nativeGetComputedStyle(element, pseudoElement)\n      } catch(e) {\n        return null\n      }\n    }\n  }\n})()\n  return Zepto\n}))\n"},,,,,function(e,t,n){e.exports=n(14)},function(e,t,n){var r,i=window.emedia=window.emedia||{},o=i.util=n(15),s=n(6);if(i.config=function(e){for(var t in e=o.extend({},e))i.config[t]=e[t],"logLevel"===t&&(i.LOG_LEVEL=e[t]);i.config.loglastConfrCount&&!i._logContext&&(i._logContext=new Array(i.config.loglastConfrCount),i._logContextIndex=-1)},i.config({autoSub:!0,onlyEnter:!1,reconnect:13,reconnectDelay:3e3,getCopyIntervalMillis:3e4,checkConnectIntervalMillis:1e3,iceRebuildCount:3,iceRebuildIntervalMillis:500,enterTimeout:2e4,useRTCCfgIfServerReturn:!1,forceUseRTCCfgIfServerReturnWhenP2P:!0,allowRepeatAudioMixerPublish:!1,getMediaMeterIntervalMillis:400,_useRequestAnimationFrame:!1,meterWithTrackAudioLevel:!1,judgeTalkingByInstantGE:.05,_printSoundData:!1,trackBufferSize:20,allowSendWhenLessThan:4,disableTrack:!1,ctrlCheckIntervalMillis:1e4,ctrlTimeoutMillis:3e4,_printDebugStats:!1,statsSeconds:3,loglastConfrCount:2,consoleLogger:!0}),o.logger.count(),r=n(2),i.browser=r.__browser,i.browserVersion=r.__browserVersion,o.logger.info("Current browser",i.browser,i.browserVersion),i.AudioContext=window.AudioContext||window.webkitAudioContext,i.config.getMediaMeterIntervalMillis){try{"function"==typeof i.AudioContext?(i.__audioContext=new i.AudioContext,i.__usingWebAudio=!0):i.__usingWebAudio=!1}catch(d){i.__usingWebAudio=!1}i.__usingWebAudio&&"suspended"===i.__audioContext.state&&s(function(){var e=function e(){"suspended"===i.__audioContext.state&&i.__audioContext.resume(),o.logger.warn("AudioContext state suspended ->",i.__audioContext.state),setTimeout(function(){"running"===i.__audioContext.state&&(document.body.removeEventListener("touchend",e,!1),document.body.removeEventListener("click",e,!1))},0)};document.body.addEventListener("touchend",e,!1),document.body.addEventListener("click",e,!1)}),i.__usingWebAudio||console.warn("'new AudioContext()' failed. can not know who talking."),i.__audioContext&&"suspended"===i.__audioContext.state&&console.warn("audioContext.state is suspended. can not know who talking. You can resume() emedia.__audioContext, but only in response to a tap.")}window.requestAnimationFrame&&i.config._useRequestAnimationFrame?i.requestAnimationFrame=function(e){window.requestAnimationFrame(e)}:i.requestAnimationFrame=function(e,t){return setTimeout(e,t||i.config.getMediaMeterIntervalMillis)},window.cancelAnimationFrame&&i.config._useRequestAnimationFrame?i.cancelAnimationFrame=function(e){window.cancelAnimationFrame(e)}:i.cancelAnimationFrame=function(e){clearTimeout(e)},i.stopAudioTracks=function(e){e&&e.getAudioTracks().forEach(function(e){e.stop()})},i.stopAndRemoveAudioTracks=function(e){var t=[];e&&e.getAudioTracks().forEach(function(e){e.stop(),t.push(e)}),o.forEach(t,function(t,n){e.removeTrack(n)})},i.stopTracks=function(e){try{if(!e||!1===e.active)return void o.logger.debug("stream tracks had been stoped. it ",e&&e.id);e.getTracks().forEach(function(e){e.stop()}),e._bindAttendee&&(o.removeAttribute(e._bindAttendee._openedRtcMediaStreams,e.id),e._bindAttendee=null),o.logger.info("stream tracks stoped. it ",e)}catch(d){o.logger.error(d)}},i.enableVideoTracks=function(e,t){e&&e.getVideoTracks().forEach(function(e){if("function"==typeof e.enable)return e.enable(),void(e.enabled===t||e.enable(t));e.enabled===t||(e.enabled=t)})},i.enableAudioTracks=function(e,t){e&&e.getAudioTracks().forEach(function(e){if("function"==typeof e.enable)return e.enable(),void(e.enabled===t||e.enable(t));e.enabled===t||(e.enabled=t)})},i.hasEnabledTracks=function(e){if(!e||"function"!=typeof e.getAudioTracks)return!1;if(!e.active)return!1;var t=e.getAudioTracks();if(0===t.length)return!1;for(var n in t)if("function"==typeof t[n].enable&&t[n].enable(),t[n].enabled)return!0;return!1},i.fileReport=function(){if(i._logContext&&i._logContext instanceof Array&&!(void 0===i._logContextIndex||i._logContextIndex<0)){var e=0,t=i._logContextIndex;i._logContextIndex>=i._logContext.length&&(e=i._logContextIndex-i._logContext.length+1);for(var n="",r=e;r<=t;r++){var o=r%i._logContext.length;n+=i._logContext[o].join("\r\n")+"\r\n"}i._logContext.loadlogs&&i._logContext.loadlogs instanceof Array&&(n+="-------------------------------------------------------------\r\n",n+=i._logContext.loadlogs.join("\r\n")+"\r\n");var s=encodeURIComponent(n),a=document.createElement("a");a.style.display="none",a.download="emedia-"+(new Date).toJSON()+".log",a.href="data:text/plain;charset=utf-8,"+s,document.body.appendChild(a),a.click(),a.parentNode.removeChild(a)}};var a=n(16),c=n(21);i.Webrtc=n(24),i.Service=a,i.P2P=n(33),i.XService=a,i.XServiceWithP2P=i.P2P(a),i.mgr=n(34).outer,i.ctrl=n(236),i.CompositeCanvas=n(242),i.pannel||(i.pannel={}),i.pannel.DefaultMouseTrack=n(30),i.pannel.MouseTrack=n(31),i.pannel.KeyboardTrack=n(243);var u=i.PCStats=n(244);if(i.helper=i.helper||{},i.helper.PCStats=u,i.helper.pcstats=u.echo,i.helper.intervalPcstats=u.intervalEcho,i.helper.inboundAudio=u.inboundAudio,i.helper.inboundVideo=u.inboundVideo,i.helper.outboundAudio=u.outboundAudio,i.helper.outboundVideo=u.outboundVideo,i.event=c,i.LOG_LEVEL=0,i.isFirefox="firefox"===i.browser,i.isChrome="chrome"===i.browser,i.isSafari="safari"===i.browser,i.isEdge="edge"===i.browser,i.isElectron=/Electron/.test(navigator.userAgent),i.isElectron)try{n(245)}catch(d){o.logger.error(d)}i.isWebRTC=window.RTCPeerConnection&&/^https\:$/.test(window.location.protocol),(i.isChrome||i.isSafari)&&(i.supportPRAnswer=!0),i.supportPRAnswer=!1,i.config({baseAcptOps:[102,104,105,106,107,300,302,303,304,301,204,206,400,401,1001,100201,100202,100203]}),i.config({clientType:"WEB",version:"2.1.1",userAgent:navigator.userAgent,acptOps:[100230,100205,1003,1004]}),e.exports=i},function(module,exports){var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},CHARS;function Util(){}CHARS="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),Math.uuid=function(e,t){var n,r,i=CHARS,o=[];if(t=t||i.length,e)for(n=0;n<e;n++)o[n]=i[0|Math.random()*t];else for(o[8]=o[13]=o[18]=o[23]="-",o[14]="4",n=0;n<36;n++)o[n]||(r=0|16*Math.random(),o[n]=i[19==n?3&r|8:r]);return o.join("")},Math.uuidFast=function(){for(var e,t=CHARS,n=new Array(36),r=0,i=0;i<36;i++)8==i||13==i||18==i||23==i?n[i]="-":14==i?n[i]="4":(r<=2&&(r=33554432+16777216*Math.random()|0),e=15&r,r>>=4,n[i]=t[19==i?3&e|8:e]);return n.join("")},Math.uuidCompact=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)})},String.prototype.startsWith||(String.prototype.startsWith=function(e,t){return t=t||0,this.indexOf(e,t)===t});var Logger=function(t){var n=this,r=0,i=1,o=2,s=3,a=4,c=5,u=["TRACE","DEBUG","INFO","WARN","ERROR","FATAL"];function d(r,i){try{!function(e,r){if(emedia&&emedia.LOG_LEVEL&&e<emedia.LOG_LEVEL)return;var i=[];i.push(e),t&&i.push(t);for(var o=0;o<r.length;o++)i.push(r[o]&&r[o]._toString?r[o]._toString.call(r[o]):r[o]);n._log.apply(n,i)}(r,i)}catch(e){if(console){if(console.error)return void console.error(e);if(console.log)return void console.log(e)}throw e}}this._log=function(){var t=arguments[0];t=arguments[0]=u[t],emedia._logContext&&function(){try{(function(){if(emedia._logContextIndex<0)return;if(!(emedia._logContext&&emedia._logContext instanceof Array))return;var e=emedia._logContextIndex%emedia._logContext.length,t=emedia._logContext[e];t&&t instanceof Array||(t=emedia._logContext[e]=[]);var n=[];n.push(emedia._logContextIndex);var r=new Date;r.toJSON?n.push(r.toJSON()):r.toISOString?n.push(r.toISOString()):n.push(r+"");for(var i=0;i<arguments.length;i++){var o=arguments[i];"string"!=typeof o?"string"!=typeof o.message?"function"!=typeof o.message?"string"!=typeof o.stack?o.event&&"function"==typeof o.event.toString?n.push(o.event.toString()):o.event&&"function"==typeof o.event.toString?n.push(o.event.toString()):"string"!=typeof o.candidate?"string"!=typeof o.sdp?o&&n.push(JSON.stringify(o)):n.push(o.sdp):n.push(o.candidate):n.push(o.stack):n.push(o.message()):n.push(o.message):n.push(o)}t.push(n.join(" "))}).apply(null,arguments)}catch(e){}}.apply(null,arguments),!0===emedia.config.consoleLogger&&(emedia&&emedia.isElectron?console.log.apply(console,arguments):console&&t&&(console[t.toLowerCase()]||console.warn).apply(console,arguments))},this.log=function(){this._log&&d(o,arguments)},this.trace=function(){this._log&&d(r,arguments)},this.debug=function(){this._log&&d(i,arguments)},this.info=function(){this._log&&d(o,arguments)},this.warn=function(){this._log&&d(s,arguments)},this.error=function(){this._log&&d(a,arguments)},this.fatal=function(){this._log&&d(c,arguments)}};Logger.prototype.count=function(){if(emedia._logContext){emedia._logContextIndex++;var e=emedia._logContextIndex%emedia._logContext.length;0===e&&0!==emedia._logContextIndex&&(emedia._logContext.loadlogs=emedia._logContext[e]),emedia._logContext[e]=[]}},Util.prototype.logger=new Logger,Util.prototype.tagLogger=function(e){return new Logger(e)},Util.prototype.parseJSON=function(e){return JSON.parse(e)};var stringifyJSON=Util.prototype.stringifyJSON=function(e){return JSON.stringify(e)},class2type={},toString=class2type.toString,hasOwn=class2type.hasOwnProperty,fnToString=hasOwn.toString,ObjectFunctionString=fnToString.call(Object),isPlainObject=Util.prototype.isPlainObject=function(e){var t,n;return!(!e||"[object Object]"!==toString.call(e)||"<JSAPI-Auto Javascript Object>"===e.toString()||"[object IFBComJavascriptObject]"===e.toString())&&(!(t=Object.getPrototypeOf(e))||"function"==typeof(n=hasOwn.call(t,"constructor")&&t.constructor)&&fnToString.call(n)===ObjectFunctionString)},e,n,engine;Util.prototype.isArray=Array.isArray,Util.prototype.isEmptyObject=function(e){var t;for(t in e)return!1;return!0},Util.prototype.type=function(e){return null==e?e+"":"object"===(void 0===e?"undefined":_typeof(e))||"function"==typeof e?class2type[toString.call(e)]||"object":void 0===e?"undefined":_typeof(e)},Util.prototype.extend=function(){var e,t,n,r,i,o,s=arguments[0]||{},a=1,c=arguments.length,u=!1;for("boolean"==typeof s&&(u=s,s=arguments[a]||{},a++),"object"===(void 0===s?"undefined":_typeof(s))||this.isFunction(s)||(s={}),a===c&&(s=this,a--);a<c;a++)if(null!=(e=arguments[a]))for(t in e)n=s[t],s!==(r=e[t])&&(u&&r&&(this.isPlainObject(r)||(i=this.isArray(r)))?(i?(i=!1,o=n&&this.isArray(n)?n:[]):o=n&&this.isPlainObject(n)?n:{},s[t]=this.extend(u,o,r)):void 0!==r&&(s[t]=r));return s},Util.prototype.removeAttribute=function(e,t){if(null!=e){var n=e[t];return delete e[t],n}},Util.prototype.prototypeExtend_000=Util.prototype.classExtend=function(){var e,t=this;function n(){for(var e=0;e<arguments.length;e++){var n=arguments[e]||{};t.extend(!0,this,n)}this.__init__&&this.__init__.apply(this,arguments)}for(var r=0;r<arguments.length;r++){var i=arguments[r]||{};"function"==typeof i?e?(i.constructor=e,i.__proto__=e.prototype):e=i:t.extend(!0,n.prototype,i)}return e&&(n.prototype.__proto__=e.prototype),e&&(n.prototype.constructor=e),n.extend||(n.extend=function(e){return t.prototypeExtend(n,e)}),n},Util.prototype.prototypeExtend=Util.prototype.classExtend=function(){var e=this;function t(){for(var t=0;t<arguments.length;t++){var n=arguments[t]||{};e.extend(!0,this,n)}this.__init__&&this.__init__.apply(this,arguments)}for(var n=0;n<arguments.length;n++){var r=arguments[n]||{};"function"==typeof r&&(r=r.prototype),e.extend(!0,t.prototype,r)}return t.extend||(t.extend=function(n){return e.prototypeExtend(t,n)}),t},Util.prototype.hasLocalStorage=function(e){return null!=localStorage.getItem(e)&&"{}"!=localStorage.getItem(e)},Util.prototype.toggleClass=function(e,t){e.hasClass(t)?e.removeClass(t):e.addClass(t)},Util.prototype.setCookie=function(e,t,n){var r=new Date;r.setTime(r.getTime()+60*n*60*1e3),document.cookie=e+"="+escape(t)+";expires="+r.toGMTString()},Util.prototype.getCookie=function(e){var t=document.cookie.match(new RegExp("(^| )"+e+"=([^;]*)(;|$)"));return null!=t?unescape(t[2]):null},Util.prototype.parseURL=function(e){var t=new RegExp("(^|&)"+e+"=([^&]*)(&|$)","i"),n=window.location.search.substr(1).match(t);return null!=n?unescape(n[2]):null},Util.prototype.forEach=function(e,t){if(e&&!(this.isArray(e)&&0===e.length||void 0!==e.length&&0===e.length))if(e.length)for(var n=0;n<e.length;n++)t(n,e[n]);else if(e&&!this.isEmptyObject(e)){e=e||{};var r=this.extend(!1,{},e);for(var i in r)t(i,e[i])}},Util.prototype.isInt=function(e){return Number(e)===e&&e%1==0},Util.prototype.isFloat=function(e){return Number(e)===e&&e%1!=0},Util.prototype.list=function(){return 1===arguments.length?[arguments[0]]:Array.apply(null,arguments)},Util.prototype.addEvent=function(e,t,n){if(e.attachEvent)return e.attachEvent("on"+t,n);if(e.addEventListener)return e.addEventListener(t,n,!1);throw"Handler could not be attached"},Util.prototype.removeEvent=function(e,t,n){if(e.detachEvent)return e.detachEvent("on"+t,n);if(e.removeEventListener)return e.removeEventListener(t,n,!1);throw"Handler could not be removed"},Util.prototype.stopEvent=function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0,e.preventDefault?e.preventDefault():e.returnValue=!1},Util.prototype.getDomPageRect=function(e){var t=e.getBoundingClientRect();return{x:t.left+(window.pageXOffset||window.document.documentElement.scrollLeft),y:t.top+(window.pageYOffset||window.document.documentElement.scrollTop),width:t.width||e.offsetWidth,height:t.height||e.offsetHeight}},Util.prototype.getEventElementXY=function(e,t,n){var r,i,o=(e=e||window.event).changedTouches?e.changedTouches[0]:e.touches?e.touches[0]:e;null!=o.pageX&&null!=o.pageY?(r=o.pageX,i=o.pageY):null!=o.clientX&&null!=o.clientY&&(r=o.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,i=o.clientY+document.body.scrollTop+document.documentElement.scrollTop);var s=this.getDomPageRect(t),a=r-s.x,c=i-s.y;return(0===n||null==n)&&(n=1),{x:Math.round(Math.max(Math.min(a,s.width-1),0)/n),y:Math.round(Math.max(Math.min(c,s.height-1),0)/n),width:Math.round(s.width/n),height:Math.round(s.height/n),realX:a,realY:c}},Util.prototype.layoutEngine=(engine={presto:!!window.opera,trident:!!window.ActiveXObject&&(window.XMLHttpRequest?document.querySelectorAll?6:5:4),webkit:function(){try{return!navigator.taintEnabled&&(i.Features.xpath?i.Features.query?525:420:419)}catch(e){return!1}}(),gecko:!(!document.getBoxObjectFor&&null==window.mozInnerScreenX)&&(document.getElementsByClassName?19:18)},engine.webkit&&(engine.webkit=(e=engine,n=(navigator.userAgent.match(/WebKit\/([0-9\.]*) /)||["",e])[1],parseFloat(n,10))),engine),Util.prototype.targetDOM="object"===("undefined"==typeof HTMLElement?"undefined":_typeof(HTMLElement))?function(e){return e instanceof HTMLElement}:function(e){return e&&"object"===(void 0===e?"undefined":_typeof(e))&&1===e.nodeType&&"string"==typeof e.nodeName},Util.prototype.cloneCSS=function(e,t){var n=window.getComputedStyle&&window.getComputedStyle(e,null)||e.currentStyle;for(var r in n){var i=n[r];/^[a-z]/i.test(r)&&[null,"",void 0].indexOf(i)<0&&(t.style[r]=i)}},Util.prototype.canYield=function(){try{return eval("!!Function('yield true;')().next()")}catch(e){return!1}}(),module.exports=new Util},function(e,t,n){var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=n(15),o=n(17),s=i.tagLogger("Service"),a=n(20),c=n(22),u=n(21),d=n(28),l=new(n(29))({onExtLoaded:function(){s.info("Share desktop ext. had loaded.")}}),f=n(26),p=n(30);e.exports=i.prototypeExtend({__init__:function(){s.warn("emedia version: ",window._emediaVersion||"unkown"),s.warn("UserAgent: ",navigator.userAgent);var e=i.parseURL("__log_level___");e&&(emedia.LOG_LEVEL=parseInt(e)),this.namespace=Math.uuidFast(),emedia.__easemob_current_mservice=this,void 0===this.useRTCCfg&&(this.useRTCCfg=emedia.config.useRTCCfgIfServerReturn),"string"==typeof this.useRTCCfg&&(this.useRTCCfg=JSON.parse(this.useRTCCfg))},AVPubstream:f.extend({__init__:function(){this.type=0,this._located=!0,this.mutedMuted=!0,this.constaints&&(this.constaints.video||(this.voff=1),this.constaints.audio||(this.aoff=1)),this.constaints||(this.constaints={audio:!0,video:!0}),emedia.config.maxVideoBitrate&&(this.vbitrate=emedia.config.maxVideoBitrate),emedia.config.maxAudioBitrate&&(this.abitrate=emedia.config.maxAudioBitrate)}}),AudioMixerPubstream:new f.extend({__init__:function(){if(this.type=2,this._located=!0,this.mutedMuted=!0,this.constaints||(this.constaints={audio:!0,video:!1}),this.constaints){var e=!!this.constaints.audio;this.constaints.video||(this.constaints.video=!1),this.constaints.video||(this.voff=1),this.constaints.audio||(this.aoff=1),!1===e&&(this.aoff=1)}emedia.config.maxVideoBitrate&&(this.vbitrate=emedia.config.maxVideoBitrate),emedia.config.maxAudioBitrate&&(this.abitrate=emedia.config.maxAudioBitrate)},onGotRemoteMediaStream:function(e){if(!this.remotePlayAudioObject){var t="__o_remote_play_audio_"+this.id,n=document.querySelector("#"+t);n||((n=document.createElement("audio")).style.display="none",n.id="__o_remote_play_audio_"+this.id,n.autoplay=!0,n.playsinline=!0,document.body.appendChild(n)),this.remotePlayAudioObject=n}this.remotePlayAudioObject.srcObject=e}}),ShareDesktopPubstream:f.extend({voff:0,__init__:function(){this.type=1,this._located=!0,this.mutedMuted=!0,this.constaints={audio:!this.aoff,video:!0},emedia.config.maxVideoBitrate&&(this.vbitrate=emedia.config.maxVideoBitrate),emedia.config.maxAudioBitrate&&(this.abitrate=emedia.config.maxAudioBitrate)}}),__assertCurrent:function(){if(!this.current)throw s.error("Please call emedia.service.setup(ticket)"),"Please call emedia.service.setup(ticket)";if(this.current.closed)throw s.error("current closed"),"current closed"},hasAudioMixers:function(){for(var e in this.__assertCurrent(),this.current.audioMixers){var t=this.current.audioMixers[e];if(t&&t.located())return!0}},getMediaDevices:function(e,t,n){"function"==typeof e&&(n=t,t=e,e=void 0),navigator.mediaDevices.enumerateDevices().then(function(n){for(var r=[],i=0;i!==n.length;++i){var o=n[i];o.deviceId,e||r.push(o),e&&e===o.kind?r.push(o):"audioinput"===o.kind||"audiooutput"===o.kind||"videoinput"===o.kind||s.info("Some other kind of source/device: ",o)}t&&t(r)}).catch(function(e){s.warn("navigator.getUserMedia error: ",e),n&&n(e)})},attachSinkId:function(e,t){void 0!==e.sinkId?e.setSinkId(t).then(function(){s.info("Success, audio output device attached: "+t)}).catch(function(e){var t=e;"SecurityError"===e.name&&(t="You need to use HTTPS for selecting audio output device: "+e),s.warn(t)}):s.warn("Browser does not support output device selection.")},_stopTracks:function(e){emedia.stopTracks(e),e&&s.warn("Stream tracks stop. it = ",e)},_enableVideoTracks:function(e,t){emedia.enableVideoTracks(e,t)},_enableAudioTracks:function(e,t){emedia.enableAudioTracks(e,t)},openUserMedia:function(e){s.debug("begin open user media",e);var t=this;if(!e)throw s.error("require pubS"),"require pubS";return{then:function(n,r){if(e instanceof t.AVPubstream)t._openCamera(e,n,r);else if(e instanceof t.ShareDesktopPubstream)t._openSharedDesktop(e,n,r);else{if(!(e instanceof t.AudioMixerPubstream))throw s.error("Unspported pubS"),"Unspported pubS";t._openCamera(e,n,r)}}}},_openSharedDesktop:function(e,t,n){var o,a=this;function c(e){var i={audio:!0};e.constaints&&("object"===r(e.constaints.audio)&&e.constaints.audio||e.constaints.audio||(i.audio=!1)),a.__getUserMedia(i,function(n,r){var i=new MediaStream;i._located=!0,r&&r.getAudioTracks().forEach(function(e){i.addTrack(e)}),e.localStream&&e.localStream.getVideoTracks().forEach(function(e){i.addTrack(e)}),e.localStream=i,t&&t(a.current,i)},n)}if(e._localMediaStream&&(o=e._localMediaStream.getVideoTracks())&&o.length>0)return e.localStream=e._localMediaStream,void(e.constaints.audio?c(e):t&&t(a.current,stream));l.openDesktopMedia(e.screenOptions||["screen","window","tab"],function(r){if(r instanceof u.OpenDesktopMedia){var o=r.desktopStreamId;s.warn("desktop streamId",o);var d={audio:!1,video:{mandatory:i.extend(e.mandatory||{},{chromeMediaSource:"desktop",chromeMediaSourceId:o}),optional:[]}};a.__getUserMedia(d,function(n,r){e.localStream=r,e.constaints.audio?c(e):t&&t(a.current,r)},n)}else a.current&&a.current.onEvent(new u.ShareDesktopExtensionNotFound({member:a.current})),n&&n(r)})},_openCamera:function(e,t,n){var r=this,i=e.constaints||{audio:!0,video:!0};r.__getUserMedia(i,function(n,i){r.__controlStream(e,i),e.localStream=i,t&&t(r.current,i)}.bind(i),n)},__controlStream:function(e,t){emedia.enableVideoTracks(t,!e.voff),emedia.enableAudioTracks(t,!e.aoff)},__getUserMedia:function(e,t,n){s.debug("Using get user media. constaints",e);var o,a=this;e=i.extend({},e),"object"===r(e.audio)&&e.audio&&(e.audio=!0),a.__sysGetUserMedia(e,function(e){a.current&&!a.current.closed&&(a.current._openedRtcMediaStreams[e.id]=e,e._bindAttendee=a.current,s.info("stream bind attendee.",e.id,a.current.ticket&&a.current.ticket.id||a.current.memName)),emedia.isSafari&&(emedia._isSafariYetPushedStream=!0),o=e;var n=e.getVideoTracks(),r=e.getAudioTracks();n.length>0&&s.debug("Using video device: "+n[0].label),r.length>0&&s.debug("Using audio device: "+r[0].label),e._located=!0,t&&t(a.current,e)},function(e){s.debug("[WebRTC-API] getUserMedia() error: ",e),emedia.stopTracks(o),a.current&&a.current.onEvent(new u.OpenMediaError({member:a.current,event:e})),n&&n(new u.OpenMediaError({member:a.current,event:e}))})},__sysGetUserMedia:function(e,t,n){function r(e,t,n){navigator.mediaDevices.getUserMedia(e).then(t).catch(n)}if(emedia.isSafari){if((e=o.extend({},e)).audio){var i={audio:e.audio};r(i,c.bind(i),u)}if(e.video){var s={video:e.video};r(s,c.bind(s),u)}e.video||e.audio||u("Failed to execute 'getUserMedia' on 'MediaDevices': At least one of audio and video must be requested")}else r(e,t,n);function a(){var n=new MediaStream;e.audioStream&&e.audioStream.getAudioTracks().forEach(function(e){n.addTrack(e)}),e.videoStream&&e.videoStream.getVideoTracks().forEach(function(e){n.addTrack(e)}),t&&t(n)}function c(t){e.failed?emedia.stopTracks(t):(!this.audio||(e.audioStream=t,e.video))&&(!this.video||(e.videoStream=t,e.audio))?e.audioStream&&e.videoStream&&a():a()}function u(t){e.failed||(e.failed=!0,n(t))}},setup:function(e,t){var n=this;s.count(),s.debug("recv ticket",e,t);var r,o,a=t=t||{};if(i.isPlainObject(t))t=JSON.stringify(t);else try{a=JSON.parse(t)}catch(p){}if("string"==typeof e&&(e=JSON.parse(e)),r=o=e.memName,n.current&&!n.current.closed){var l=new u.CurrentCalling;throw n.current.onEvent(l),s.error("confr not close. calling..."),l}var f=(n.Attendee||c).extend(d);return n.current=new f({_service:n,autoSub:emedia.config.autoSub,getCopyIntervalMillis:emedia.config.getCopyIntervalMillis,sysUserId:r,memName:o,resource:n.resource,nickName:n.nickName,ticket:e,ext:t,extObj:a,sessionFactory:function(){return n.newSession(this,e)}},n.listeners||{})},getStreamById:function(e){var t=this.current&&this.current._cacheStreams[e];return t&&i.extend(!1,{},t)},getMemberById:function(e){var t=this.current&&this.current._cacheMembers[e];return t&&i.extend(!1,{},t)},exit:function(e){s.warn("User click exit ",e),this.current&&this.current.exit(e)},join:function(e,t){s.debug("begin join ...");if(this.__assertCurrent(),this.current._memberId)return s.warn("Had joined. igrone it"),void(e&&e(this.memId));this.current._session._sessionId=void 0,this.current.join(e,t)},withpublish:function(e){if(!e||!e.localStream)throw s.error("pubS null or stream not open"),"pubS null or stream not open";return this.__assertCurrent(),this.current._memberId?s.warn("Had joined. igrone it"):this.current._session._sessionId=void 0,this.current.withpublish(e)},push:function(e,t,n){s.debug("begin push ...");if(2===arguments.length&&(n=t,t=void 0),!e||!e.localStream)throw s.error("pubS or stream open"),"pubS or stream open";this.__assertCurrent(),this.current.push(e,t,n,!1)},subscribe:function(e,t,n,r){var o=this;if(s.info("begin subscribe ",e,r),t&&i.isPlainObject(t)&&(r=t,t=n=void 0),n&&i.isPlainObject(n)&&(r=n,n=t,t=void 0),emedia.isSafari){var a=function(){try{var e=l.shift();e&&e.onSub&&e.onSub.apply(e,arguments)}finally{u()}},c=function(){try{var e=l.shift();e&&e.subfail&&e.subfail.apply(e,arguments)}finally{u()}},u=function(){l.length>0&&o.__subscribe(l[0].streamId,a,c,l[0].subArgs)},d={streamId:e,onSub:t,subfail:n,subArgs:r},l=o.__safari_subs||(o.__safari_subs=[]);l.push(d),1===l.length&&u()}else o.__subscribe(e,t,n,r)},__subscribe:function(e,t,n,r){this.__assertCurrent(),2==arguments.length&&(n=t,t=void 0),t&&i.isPlainObject(t)&&(r=t,t=void 0),n&&i.isPlainObject(n)&&(r=n,n=void 0),r||(r={subSVideo:!0,subSAudio:!0});this.current._cacheStreams[e];var o=this.current._getWebrtc(e),a=o&&o.isConnected(),c=a&&o.getRemoteStream();if(c&&(a=c.active)){var u=c.getAudioTracks().length,d=c.getVideoTracks().length;(u||!0!==r.subSAudio)&&(d||!0!==r.subSVideo)||(a=!1)}if(s.info("sub stream",e,", use prertcpeer =",a),a)return this.current.subscribeStream(o._rtcId,e,n,r,t),void(t&&t());o&&!o.closed&&this.current.closeWebrtc(o.getRtcId(),!0,!1),this.current.createWebrtcAndSubscribeStream(e,{onGotRemote:function(e){t&&t(e)},onEvent:function(e){n&&n(e)}},void 0,r)},closePubstream:function(e){e.located()&&(emedia.stopTracks(e._localMediaStream),emedia.stopTracks(e.localStream))},hungup:function(e){var t=this.getStreamById(e);try{this._hungup(e)}finally{this.onHungup&&t&&this.onHungup(t)}},_hungup:function(e){this.__assertCurrent();var t=this.current,n=t._cacheStreams[e],r=n&&n.rtcId;if(r&&(t.closeWebrtc(r),n.located()&&(1!==n.type&&n._localMediaStream&&emedia.stopTracks(n._localMediaStream),n.remotePlayAudioObject&&document.body.removeChild(n.remotePlayAudioObject),t._cacheStreams[e]&&t.onRemoveStream(n),i.removeAttribute(t._cacheStreams,e))),n&&!n.located()){if(t._linkedStreams[n.id]&&i.removeAttribute(t._linkedStreams,n.id),s.warn("Hangeup remove from _linkedStreams. stream = ",n.id),!(n=t._cacheStreams[e]))return;var o=new f(n);n.rtcId=o.rtcId=void 0,n._webrtc=o._webrtc=void 0,n.mediaStream=o.mediaStream=void 0,t.onUpdateStream(o,new o.Update(o))}},postMessage:function(e,t,n,r){var i=t;"string"!=typeof t&&(t=JSON.stringify(t)),this.__assertCurrent();var o,s=this.current,a=s._linkedStreams[e];o=a&&a.owner?a.owner.id:e;t=s.newMessage({op:1003,memId:o,arg:t});s.postMessage(t,(n||r)&&function(e){if(r&&r(e,i),0!=e.result){var a=new u.RemoteControlFail({memId:o,failed:e.result,cause:e.msg,type:"postMessage",postMessage:t});return s.onEvent(a),void(n&&n(a,i))}})},torchRemote:function(e,t,n,r){"function"==typeof t&&(r=n,n=t,t=void 0),void 0!==t&&(t=t?1:0),this.__assertCurrent();var i=this.current,o=i._linkedStreams[e];if(!o||o.located())throw s.error("not exsits or locate, not connect",e),e+" not exsits or locate, not connect";var a=o.torch,c={op2:20,streamId:e,tor:t=void 0===t?o.torch?0:1:t},d=i.newMessage({op:1002,memId:o.owner.id,arg:JSON.stringify(c),_reqOps:[100206]});o.torch=t,i.postMessage(d,function(e){if(0!=e.result){var t=new u.RemoteControlFail({stream:o,failed:e.result,cause:e.msg,type:"torch_control"});return i.onEvent(t),o.torch=a,void(r&&r(t,o.torch))}n&&n(o.torch)})},freezeFrameRemote:function(e,t,n){this.__assertCurrent();var r=this.current,i=r._linkedStreams[e];if(!i||i.located())throw s.error("not exsits or locate, not connect",e),e+" not exsits or locate, not connect";var o=!i.freezeFrame,a={op2:20,streamId:e,frz:o?1:0},c=r.newMessage({op:1002,memId:i.owner.id,arg:JSON.stringify(a),_reqOps:[100204]});i.freezeFrame=o,r.postMessage(c,function(e){if(0!=e.result){var o=new u.RemoteControlFail({stream:i,failed:e.result,cause:e.msg,type:"freeze_control"});return r.onEvent(o),i.freezeFrame=!i.freezeFrame,void(n&&n(o,i.freezeFrame))}t&&t(i.freezeFrame)})},base64Img2Blob:function(e){for(var t=e.split(";base64,"),n=t[0].split(":")[1],r=window.atob(t[1]),i=r.length,o=new Uint8Array(i),s=0;s<i;++s)o[s]=r.charCodeAt(s);return new Blob([o],{type:n})},blob2URL:function(e){return URL.createObjectURL(e)},imagesPngContext2URL:function(e){return this.blob2URL(this.blob2URL(e))},downloadFile:function(e,t,n){var r=document.createElement("a");r.style.display="none";var i,o=t?this.base64Img2Blob(t):n;r.download=e,r.href=i=this.blob2URL(o),r.rel="noopener";var s=document.createEvent("HTMLEvents");s.initEvent("click",!1,!1),r.dispatchEvent(s),document.body.appendChild(r),r.click(),r.parentNode.removeChild(r),setTimeout(function(){URL.revokeObjectURL&&URL.revokeObjectURL(i)},4e4)},videoCaptureBase64Context2URL:function(e){return this.imagesPngContext2URL(this.getCaptureBase64Context(e))},getCaptureBase64Context:function(e){var t=document.createElement("canvas");t.id="__capture_video_"+(new Date).getTime();return t.width=e.videoWidth,t.height=e.videoHeight,t.getContext("2d").drawImage(e,0,0,t.width,t.height),t.toDataURL("images/png")},captureVideo:function(e,t,n){var r=this.getCaptureBase64Context(e);return t&&(n=n||"capture_"+(new Date).getTime(),this.downloadFile(n,r)),r},capturePictureRemote:function(e,t,n,r){this.__assertCurrent();var i=this.current,o=i._linkedStreams[e];if(!o||o.located())throw s.error("not exsits or locate, not connect",e),e+" not exsits or locate, not connect";var a={op2:20,streamId:e,pic:1,rspBase64Pic:!0===t},c=i.newMessage({op:1002,memId:o.owner.id,arg:JSON.stringify(a),_reqOps:[100205]});i.postMessage(c,function(e){if(0!=e.result){var s=new u.RemoteControlFail({stream:o,failed:e.result,cause:e.msg,type:"capture_control"});return i.onEvent(s),void(r&&r(s))}if(t)if(e.arg){var a=JSON.parse(e.arg);n&&n(a.pic)}else r&&r(new u.RemoteControlFail({stream:o,failed:e.result,cause:"Not found base64 pic"}));else n&&n()})},zoomRemote:function(e,t,n,r){this.__assertCurrent();var i=this.current,o=i._linkedStreams[e];if(!o||o.located())throw s.error("not exsits or locate, not connect",e),e+" not exsits or locate, not connect";o._zoom||(o._zoom=1);var a=o._zoom*t;if(!(a<1)){o._zoom=a;var c={op2:20,streamId:e,zoom:Math.round(1e4*a)},d=i.newMessage({op:1002,memId:o.owner.id,arg:JSON.stringify(c),_reqOps:[100201]});i.postMessage(d,function(e){if(0!=e.result){var t=new u.RemoteControlFail({stream:o,failed:e.result,cause:e.msg,type:"zoom_control"});return i.onEvent(t),void(n&&n(t))}r&&r()})}},_getPosition:function(e){for(var t=0,n=0;e;)n+=e.offsetLeft,t+=e.offsetTop,e=e.offsetParent;return{clientX:n,clientY:t}},eventXYAtMedia:function(e,t){var n=i.getDomPageRect(t),r=n.width,o=n.height,s=t.videoWidth,a=t.videoHeight;if(a/s>o/r){var c=s/a;s=(a=o)*c}else{c=a/s;a=(s=r)*c}var u,d,l=e;if((u=i.isFloat(l.x))&&(l.x=l.x*r),(d=i.isFloat(l.y))&&(l.y=l.y*o),!(Math.abs(l.x)<(r-s)/2||r-Math.abs(l.x)<(r-s)/2||Math.abs(l.y)<(o-a)/2||o-Math.abs(l.y)<(o-a)/2))return l.x=l.x<0?Math.floor(l.x+(r-s)/2):Math.floor(l.x-(r-s)/2),l.y=l.y<0?Math.floor(l.y+(o-a)/2):Math.floor(l.y-(o-a)/2),u&&(l.x=l.x/s),d&&(l.y=l.y/a),{x:l.x,y:l.y,width:s,height:a}},eventXYAtVideo:function(e,t){var n,r,o=i.getDomPageRect(t),s=o.width,a=o.height,c=t.videoWidth,u=t.videoHeight;if(u/c>a/s){var d=c/u;c=(u=a)*d}else{d=u/c;u=(c=s)*d}return(n=i.isFloat(e.x))&&(e.x=e.x*c),(r=i.isFloat(e.y))&&(e.y=e.y*u),e.x=e.x<0?Math.floor(e.x-(s-c)/2):Math.floor(e.x+(s-c)/2),e.y=e.y<0?Math.floor(e.y-(a-u)/2):Math.floor(e.y+(a-u)/2),n&&(e.x=e.x/s),r&&(e.y=e.y/a),e},getClickXY:function(e,t){var n=t||window.event,r=document.documentElement.scrollLeft||document.body.scrollLeft,i=document.documentElement.scrollTop||document.body.scrollTop,o=n.pageX||n.clientX+r,a=n.pageY||n.clientY+i,c=this._getPosition(e);s.info("Video tag position ",c.clientX,":",c.clientY);var u=e.videoWidth,d=e.videoHeight;if(d/u>e.offsetHeight/e.offsetWidth){var l=u/d;u=(d=e.offsetHeight)*l,c.clientX+=(e.offsetWidth-u)/2}else{l=d/u;d=(u=e.offsetWidth)*l,c.clientY+=(e.offsetHeight-d)/2}return s.info("Media position ",c.clientX,":",c.clientY),s.info("Media xy ",u,":",d),s.info("Click position ",o,":",a),{mediaWidth:u,mediaHeight:d,x:o-c.clientX,y:a-c.clientY}},focusExpoRemote:function(e,t,n,r,i){var o=n||window.event,a=document.documentElement.scrollLeft||document.body.scrollLeft,c=document.documentElement.scrollTop||document.body.scrollTop,u=o.pageX||o.clientX+a,d=o.pageY||o.clientY+c,l=this._getPosition(t);s.info("Video tag position ",l.clientX,":",l.clientY);var f=t.videoWidth,p=t.videoHeight;if(p/f>t.offsetHeight/t.offsetWidth){var h=f/p;f=(p=t.offsetHeight)*h,l.clientX+=(t.offsetWidth-f)/2}else{h=p/f;p=(f=t.offsetWidth)*h,l.clientY+=(t.offsetHeight-p)/2}s.info("Media position ",l.clientX,":",l.clientY),s.info("Media xy ",f,":",p),s.info("Click position ",u,":",d),this._focusExpo(e,f,p,u-l.clientX,d-l.clientY,r,i)},_focusExpo:function(e,t,n,r,i,o,a){if(!(r<=0||r>t||i<=0||i>n)){this.__assertCurrent();var c=this.current,d=c._linkedStreams[e];if(!d||d.located())throw s.error("not exsits or locate, not connect",e),e+" not exsits or locate, not connect";var l={op2:20,streamId:e,focus:1,expo:1,x:0===t?0:Math.round(1e4*r/t),y:0===n?0:Math.round(1e4*i/n)},f=c.newMessage({op:1002,memId:d.owner.id,arg:JSON.stringify(l),_reqOps:[100202,100203]});c.postMessage(f,function(e){if(0!=e.result){var t=new u.RemoteControlFail({stream:d,failed:e.result,cause:e.msg,type:"focus_expo_control"});return c.onEvent(t),void(o&&o(t))}a&&a()})}},_republish:function(e,t,n){s.info("Republish stream. it = ",e.id);var r,i,o=this;if(e.id){var a=o.current.__getWebrtcFor(e.id);a&&o.current.closeWebrtc(a,!0),r=o.current._getWebrtc(e.id)}switch(e.type){case 0:emedia.stopTracks(e._localMediaStream),i=new o.AVPubstream(e);break;case 1:emedia.stopAndRemoveAudioTracks(e._localMediaStream),i=new o.ShareDesktopPubstream(e);break;case 2:emedia.stopTracks(e._localMediaStream),i=new o.AudioMixerPubstream(e)}setTimeout(function(){o.openUserMedia(i).then(function(){e.localStream=i.localStream,e.isRepublished=!0,e.optimalVideoCodecs=e.optimalVideoCodecs||r&&r.optimalVideoCodecs,o.push(e,t,n)},n)},100)},chanageCamera:function(e,t,n){var i=this;"string"==typeof e?e=i.current._cacheStreams[e]:e.id&&(e=i.current._cacheStreams[e.id]),e.voff?s.warn("Stream id = ",e.id," voff, do not chanage camera."):i.getMediaDevices("videoinput",function(o){if(o.length<=1)s.warn("Only video input. not chanage");else{for(var a=null===e._cameraIndex||void 0===e._cameraIndex?0:e._cameraIndex;a<o.length;){var c=o[a],u=o[a=(a+1)%o.length],d=e._localMediaStream.getVideoTracks();if(!d||0===d.length||u.label!=d[0].label)break}var l=(u=o[a]).label;s.warn("Stream ",e.id,c.label,">>",l),e._cameraIndex=a,e.constaints||(e.constaints={}),e.constaints.video="object"===r(e.constaints.video)?e.constaints.video:{},e.constaints.video.deviceId={exact:u.deviceId},i._republish(e,function(e){n&&n(e)},function(n){n instanceof emedia.event.OpenMediaError&&(e.constaints.video=!1),t&&t(n)})}},t)},_republishByVideoConstaints:function(e,t,n,r){var i=this;"string"==typeof e&&(e=i.current._cacheStreams[e]);var a=(e=o.extend({},e)).voff,c=e.voff=t?0:1;function u(){c!==a?(emedia.enableVideoTracks(e.getMediaStream(),!c),i.current&&i.current.voff(e,c)):s.info("pubstream voff not chanage.")}if(o.isObject(t)&&!o.isEqual(e.constaints.video,t)||t&&!e.constaints.video)return e.constaints.video=t,void i._republish(e,function(e){u(),r&&r(e)},function(t){t instanceof emedia.event.OpenMediaError&&(e.constaints.video=!1),n&&n(t)});u(),r&&r(e.getMediaStream())},voff:function(e,t,n,r){var i=this;"string"==typeof e&&(e=i.current._cacheStreams[e]);var o=e.voff;function a(){t!=o?(emedia.enableVideoTracks(e.getMediaStream(),!t),i.current&&i.current.voff(e,t)):s.info("pubstream voff not chanage.")}if(t=t?1:0,e.voff=t,!t&&e.constaints&&!e.constaints.video){var c=e.constaints.video;return e.constaints.video=!0,void i._republish(e,function(e){a(),r&&r(e)},function(t){t instanceof emedia.event.OpenMediaError&&(e.constaints.video=c),n&&n(t)})}a(),r&&r(e.getMediaStream())},aoff:function(e,t,n,r){var i=this;"string"==typeof e&&(e=i.current._cacheStreams[e]);var o=e.aoff;function a(){t!=o?(emedia.enableAudioTracks(e.getMediaStream(),!t),i.current&&i.current.aoff(e,t)):s.info("pubstream aoff not chanage.")}if(t=t?1:0,e.aoff=t,!t&&e.constaints&&!e.constaints.audio){var c=e.constaints.audio;return e.constaints.audio=!0,void i._republish(e,function(e){a(),r&&r(e)},function(t){t instanceof emedia.event.OpenMediaError&&(e.constaints.audio=c),n&&n(t)})}a(),r&&r(e.getMediaStream())},iceing:function(e){return i.isPlainObject(this.current._linkedStreams[e])},recording:function(e){return i.isPlainObject(this.current._records[e])},startRecord:function(e,t){var n=this.current._linkedStreams[e];if(!n)throw s.error("not at linked streams",e),e+" not at linked streams";n._webrtc||t&&t(!1),this.current.startRecord(n,t)},stopRecord:function(e,t){var n=this.current._records[e];if(!n)throw s.error("not at recording streams",e),e+" not at recording streams";this.current.stopRecord(n,t)},getCurrentMembers:function(){return this.current.getCurrentMembers()},_onCapturePicture:function(e){var t,n=e.arg.rspBase64Pic,r=e.arg.streamId,i=this.current._cacheStreams[r];if(n){var o;if("function"!=typeof this.getHTMLVideo||!(o=this.getHTMLVideo(r)))return void s.warn("Not support capture picture. caused by htmlVideo not found");t=this.getCaptureBase64Context(o)}else{if("function"!=typeof this.onCapturePicture)return void s.warn("Not support capture picture. caused by onCapturePicture not found");this.onCapturePicture(i)}var a=this.current.newMessage({op:1001,tsxId:e.tsxId,memId:e.memId,arg:JSON.stringify(t?{pic:t}:{}),result:0});return this.current.postMessage(a,function(e){s.warn("Send remote control onCapturePicture response. the result = ",e.result,e.msg||"")}),!0},newSession:function(e,t){var n=this;return new(n.Session||a)({ticket:t,owner:e,onTcklC:function(t){e.onTcklC(t.rtcId,t.cands)},onAcptC:function(t){e.onAcptC(t.rtcId,t.sdp,t.cands)},onAnsC:function(t){e.onAnsC(t.rtcId,t.sdp,t.cands)},onTermC:function(t){s.info("Server termc rtc: ",t.rtcId,t.message||t.msg),21===t.endReason||22===t.endReason?i.forEach(e._cacheStreams,function(n,r){var i;r.rtcId===t.rtcId&&(i=21===t.endReason?new emedia.event.SwitchVCodes({stream:r,useVCodes:t.useVCodes}):new emedia.event.SubFailNotSupportVCodes({stream:r}),e.onEvent(i))}):e.closeWebrtc(t.rtcId,!1,!0)},onEnter:function(t){e.onEnter(t.cver,t.mem)},onExit:function(t){e.onExit(t.cver,t.memId,t.reason||0)},onPub:function(t){e.onPub(t.cver,t.memId,t.pubS)},onUnpub:function(t){e.onUnpub(t.cver,t.memId,t.pubSId)},onMems:function(e){},onClose:function(t){e.onClose(t.cver,t.confrId)},onEvent:function(t){e.onEvent(t)},onStreamControl:function(t){e.onStreamControl(t.cver,t.streamId,t.voff,t.aoff,t.sver)},onRoleUpdate:function(t){e._onRoleUpdate(t.role,t.roleToken)},onRemoteControl:function(t){if("string"==typeof t.arg&&(t.arg=JSON.parse(t.arg)),20!==t.arg.op2||!t.arg.pic||!n._onCapturePicture.call(n,t)){if(30===t.arg.op2&&n._onRemotePannelControl)try{return void n._onRemotePannelControl.call(n,t)}catch(i){s.warn(i)}s.warn("Not support remote control");var r=e.newMessage({op:1001,tsxId:t.tsxId,memId:t.memId,arg:JSON.stringify(t.arg),result:t&&t.arg&&30===t.arg.op2?-405:-507,msg:"Not support the remote control."});e.postMessage(r,function(e){s.warn("Send remote control response. the result = ",e.result,e.msg||"")})}},onRecvRemoteMessage:function(t){e._onRecvRemoteMessage&&e._onRecvRemoteMessage(t.memId,t.arg,t)}})},_judgeTalking:function(e){return!!e&&e.instant>=emedia.config.judgeTalkingByInstantGE},graffitiVideo:function(e,t,n){var r=this.getStreamById(e),i=new MediaStream;i._located=!0,r._localMediaStream.getAudioTracks().forEach(function(e){i.addTrack(e)}),n.captureStream(25).getVideoTracks().forEach(function(e){i.addTrack(e)}),t.srcObject=i,r.localStream=i,r.isRepublished=!0,r.optimalVideoCodecs=r.optimalVideoCodecs,this.push(r)},resetCanvas:function(e){var t;if(arguments.length>1)for(var n=0;n<arguments.length;n++)"function"==typeof(t=arguments[n])&&t(e),"function"!=typeof t&&i.isPlainObject(t)&&i.forEach(t,function(t,n){s.debug("Canvas set ",t," = ",n),e.setAttribute(t,n)})},_random:function(e){return Math.floor(Math.random()*e)},requestFrame:function(e,t){var n,r=this;if("string"==typeof e)n=this.current._cacheStreams[e];else{if(!e.id)return;n=this.current._cacheStreams[e.id]}function i(){(n.requestFrame(),n.canvas)&&p.prototype.redraw.bind({_canvasContext:n.canvas.getContext("2d")})(3,3)}n&&(t?setTimeout(function(){i(),r.requestFrame(n,t)},t):i())},graffitiCanvas:function(e,t){i.targetDOM(e)&&(t=e,e=!1);var n=this,r=new n.ShareDesktopPubstream({voff:0,aoff:e?0:1});t||(t=document.createElement("canvas")),t.getContext("2d"),r.canvas=t;var o=function(){};return o.prototype.setCanvas=function(e){return this.canvasTag=t,n.resetCanvas(t,e),this},o.prototype.push=function(e,t){this._push(e,t)},o.prototype._push=function(i,o){"function"==typeof i&&(o=i,i=void 0),t.captureStream&&(t.captureStream.enabled=!0);var s=t.captureStream(i||25);function a(n){n.canvas=t,o&&o(n,t,s),e&&n.requestFrame()}function c(e,t){var r=new MediaStream;r._located=!0,e._localMediaStream&&e._localMediaStream.getAudioTracks().forEach(function(e){r.addTrack(e)}),s.getVideoTracks().forEach(function(e){r.addTrack(e)}),e._localMediaStream=r,e.localStream=r,n.push(e,t)}return e?n.__getUserMedia({audio:!0},function(e,t){r._localMediaStream=t,c(r,a)}):c(r,a),this},new o},blobRecorder:function(e,t,n,r){var o=this;i.targetDOM(e)&&(e=e.srcObject),t||(t={mimeType:"video/webm;codecs=vp9"}),MediaRecorder.isTypeSupported(t.mimeType)||(s.info(t.mimeType," is not Supported"),t={mimeType:"video/webm;codecs=vp8"},MediaRecorder.isTypeSupported(t.mimeType)||(s.info(t.mimeType," is not Supported"),t={mimeType:"video/webm"},MediaRecorder.isTypeSupported(t.mimeType)||(s.info(t.mimeType," is not Supported"),t={mimeType:""})));try{var a=new MediaRecorder(e,t)}catch(d){return void s.error("Exception while creating MediaRecorder: ",d)}var c=[];function u(){this.blobs=c}return a.onstop=r||function(e){s.info("Recorder stopped: ",e)},a.ondataavailable=n||function(e){e.data&&e.data.size>0&&c.push(e.data)},u.prototype.start=function(e){a.start(e)},u.prototype.stop=function(){a.stop()},u.prototype.playurl=function(e){var t=new Blob(this.blobs,e||{type:"video/webm"});return window.URL.createObjectURL(t)},u.prototype.download=function(e,t){var n=new Blob(this.blobs,t||{type:"video/webm"});o.downloadFile(e,void 0,n)},new u}})},function(e,t,n){(function(e,n){var r;!function(){var i="object"==typeof self&&self.self===self&&self||"object"==typeof e&&e.global===e&&e||this||{},o=i._,s=Array.prototype,a=Object.prototype,c="undefined"!=typeof Symbol?Symbol.prototype:null,u=s.push,d=s.slice,l=a.toString,f=a.hasOwnProperty,p=Array.isArray,h=Object.keys,m=Object.create,v=function(){},b=function(e){return e instanceof b?e:this instanceof b?void(this._wrapped=e):new b(e)};void 0===t||t.nodeType?i._=b:(void 0!==n&&!n.nodeType&&n.exports&&(t=n.exports=b),t._=b),b.VERSION="1.9.1";var g,_=function(e,t,n){if(void 0===t)return e;switch(null==n?3:n){case 1:return function(n){return e.call(t,n)};case 3:return function(n,r,i){return e.call(t,n,r,i)};case 4:return function(n,r,i,o){return e.call(t,n,r,i,o)}}return function(){return e.apply(t,arguments)}},y=function(e,t,n){return b.iteratee!==g?b.iteratee(e,t):null==e?b.identity:b.isFunction(e)?_(e,t,n):b.isObject(e)&&!b.isArray(e)?b.matcher(e):b.property(e)};b.iteratee=g=function(e,t){return y(e,t,1/0)};var S=function(e,t){return t=null==t?e.length-1:+t,function(){for(var n=Math.max(arguments.length-t,0),r=Array(n),i=0;i<n;i++)r[i]=arguments[i+t];switch(t){case 0:return e.call(this,r);case 1:return e.call(this,arguments[0],r);case 2:return e.call(this,arguments[0],arguments[1],r)}var o=Array(t+1);for(i=0;i<t;i++)o[i]=arguments[i];return o[t]=r,e.apply(this,o)}},w=function(e){if(!b.isObject(e))return{};if(m)return m(e);v.prototype=e;var t=new v;return v.prototype=null,t},x=function(e){return function(t){return null==t?void 0:t[e]}},C=function(e,t){return null!=e&&f.call(e,t)},E=function(e,t){for(var n=t.length,r=0;r<n;r++){if(null==e)return;e=e[t[r]]}return n?e:void 0},T=Math.pow(2,53)-1,I=x("length"),R=function(e){var t=I(e);return"number"==typeof t&&t>=0&&t<=T};b.each=b.forEach=function(e,t,n){var r,i;if(t=_(t,n),R(e))for(r=0,i=e.length;r<i;r++)t(e[r],r,e);else{var o=b.keys(e);for(r=0,i=o.length;r<i;r++)t(e[o[r]],o[r],e)}return e},b.map=b.collect=function(e,t,n){t=y(t,n);for(var r=!R(e)&&b.keys(e),i=(r||e).length,o=Array(i),s=0;s<i;s++){var a=r?r[s]:s;o[s]=t(e[a],a,e)}return o};var k=function(e){return function(t,n,r,i){var o=arguments.length>=3;return function(t,n,r,i){var o=!R(t)&&b.keys(t),s=(o||t).length,a=e>0?0:s-1;for(i||(r=t[o?o[a]:a],a+=e);a>=0&&a<s;a+=e){var c=o?o[a]:a;r=n(r,t[c],c,t)}return r}(t,_(n,i,4),r,o)}};b.reduce=b.foldl=b.inject=k(1),b.reduceRight=b.foldr=k(-1),b.find=b.detect=function(e,t,n){var r=(R(e)?b.findIndex:b.findKey)(e,t,n);if(void 0!==r&&-1!==r)return e[r]},b.filter=b.select=function(e,t,n){var r=[];return t=y(t,n),b.each(e,function(e,n,i){t(e,n,i)&&r.push(e)}),r},b.reject=function(e,t,n){return b.filter(e,b.negate(y(t)),n)},b.every=b.all=function(e,t,n){t=y(t,n);for(var r=!R(e)&&b.keys(e),i=(r||e).length,o=0;o<i;o++){var s=r?r[o]:o;if(!t(e[s],s,e))return!1}return!0},b.some=b.any=function(e,t,n){t=y(t,n);for(var r=!R(e)&&b.keys(e),i=(r||e).length,o=0;o<i;o++){var s=r?r[o]:o;if(t(e[s],s,e))return!0}return!1},b.contains=b.includes=b.include=function(e,t,n,r){return R(e)||(e=b.values(e)),("number"!=typeof n||r)&&(n=0),b.indexOf(e,t,n)>=0},b.invoke=S(function(e,t,n){var r,i;return b.isFunction(t)?i=t:b.isArray(t)&&(r=t.slice(0,-1),t=t[t.length-1]),b.map(e,function(e){var o=i;if(!o){if(r&&r.length&&(e=E(e,r)),null==e)return;o=e[t]}return null==o?o:o.apply(e,n)})}),b.pluck=function(e,t){return b.map(e,b.property(t))},b.where=function(e,t){return b.filter(e,b.matcher(t))},b.findWhere=function(e,t){return b.find(e,b.matcher(t))},b.max=function(e,t,n){var r,i,o=-1/0,s=-1/0;if(null==t||"number"==typeof t&&"object"!=typeof e[0]&&null!=e)for(var a=0,c=(e=R(e)?e:b.values(e)).length;a<c;a++)null!=(r=e[a])&&r>o&&(o=r);else t=y(t,n),b.each(e,function(e,n,r){((i=t(e,n,r))>s||i===-1/0&&o===-1/0)&&(o=e,s=i)});return o},b.min=function(e,t,n){var r,i,o=1/0,s=1/0;if(null==t||"number"==typeof t&&"object"!=typeof e[0]&&null!=e)for(var a=0,c=(e=R(e)?e:b.values(e)).length;a<c;a++)null!=(r=e[a])&&r<o&&(o=r);else t=y(t,n),b.each(e,function(e,n,r){((i=t(e,n,r))<s||i===1/0&&o===1/0)&&(o=e,s=i)});return o},b.shuffle=function(e){return b.sample(e,1/0)},b.sample=function(e,t,n){if(null==t||n)return R(e)||(e=b.values(e)),e[b.random(e.length-1)];var r=R(e)?b.clone(e):b.values(e),i=I(r);t=Math.max(Math.min(t,i),0);for(var o=i-1,s=0;s<t;s++){var a=b.random(s,o),c=r[s];r[s]=r[a],r[a]=c}return r.slice(0,t)},b.sortBy=function(e,t,n){var r=0;return t=y(t,n),b.pluck(b.map(e,function(e,n,i){return{value:e,index:r++,criteria:t(e,n,i)}}).sort(function(e,t){var n=e.criteria,r=t.criteria;if(n!==r){if(n>r||void 0===n)return 1;if(n<r||void 0===r)return-1}return e.index-t.index}),"value")};var O=function(e,t){return function(n,r,i){var o=t?[[],[]]:{};return r=y(r,i),b.each(n,function(t,i){var s=r(t,i,n);e(o,t,s)}),o}};b.groupBy=O(function(e,t,n){C(e,n)?e[n].push(t):e[n]=[t]}),b.indexBy=O(function(e,t,n){e[n]=t}),b.countBy=O(function(e,t,n){C(e,n)?e[n]++:e[n]=1});var M=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;b.toArray=function(e){return e?b.isArray(e)?d.call(e):b.isString(e)?e.match(M):R(e)?b.map(e,b.identity):b.values(e):[]},b.size=function(e){return null==e?0:R(e)?e.length:b.keys(e).length},b.partition=O(function(e,t,n){e[n?0:1].push(t)},!0),b.first=b.head=b.take=function(e,t,n){return null==e||e.length<1?null==t?void 0:[]:null==t||n?e[0]:b.initial(e,e.length-t)},b.initial=function(e,t,n){return d.call(e,0,Math.max(0,e.length-(null==t||n?1:t)))},b.last=function(e,t,n){return null==e||e.length<1?null==t?void 0:[]:null==t||n?e[e.length-1]:b.rest(e,Math.max(0,e.length-t))},b.rest=b.tail=b.drop=function(e,t,n){return d.call(e,null==t||n?1:t)},b.compact=function(e){return b.filter(e,Boolean)};var A=function(e,t,n,r){for(var i=(r=r||[]).length,o=0,s=I(e);o<s;o++){var a=e[o];if(R(a)&&(b.isArray(a)||b.isArguments(a)))if(t)for(var c=0,u=a.length;c<u;)r[i++]=a[c++];else A(a,t,n,r),i=r.length;else n||(r[i++]=a)}return r};b.flatten=function(e,t){return A(e,t,!1)},b.without=S(function(e,t){return b.difference(e,t)}),b.uniq=b.unique=function(e,t,n,r){b.isBoolean(t)||(r=n,n=t,t=!1),null!=n&&(n=y(n,r));for(var i=[],o=[],s=0,a=I(e);s<a;s++){var c=e[s],u=n?n(c,s,e):c;t&&!n?(s&&o===u||i.push(c),o=u):n?b.contains(o,u)||(o.push(u),i.push(c)):b.contains(i,c)||i.push(c)}return i},b.union=S(function(e){return b.uniq(A(e,!0,!0))}),b.intersection=function(e){for(var t=[],n=arguments.length,r=0,i=I(e);r<i;r++){var o=e[r];if(!b.contains(t,o)){var s;for(s=1;s<n&&b.contains(arguments[s],o);s++);s===n&&t.push(o)}}return t},b.difference=S(function(e,t){return t=A(t,!0,!0),b.filter(e,function(e){return!b.contains(t,e)})}),b.unzip=function(e){for(var t=e&&b.max(e,I).length||0,n=Array(t),r=0;r<t;r++)n[r]=b.pluck(e,r);return n},b.zip=S(b.unzip),b.object=function(e,t){for(var n={},r=0,i=I(e);r<i;r++)t?n[e[r]]=t[r]:n[e[r][0]]=e[r][1];return n};var P=function(e){return function(t,n,r){n=y(n,r);for(var i=I(t),o=e>0?0:i-1;o>=0&&o<i;o+=e)if(n(t[o],o,t))return o;return-1}};b.findIndex=P(1),b.findLastIndex=P(-1),b.sortedIndex=function(e,t,n,r){for(var i=(n=y(n,r,1))(t),o=0,s=I(e);o<s;){var a=Math.floor((o+s)/2);n(e[a])<i?o=a+1:s=a}return o};var j=function(e,t,n){return function(r,i,o){var s=0,a=I(r);if("number"==typeof o)e>0?s=o>=0?o:Math.max(o+a,s):a=o>=0?Math.min(o+1,a):o+a+1;else if(n&&o&&a)return r[o=n(r,i)]===i?o:-1;if(i!=i)return(o=t(d.call(r,s,a),b.isNaN))>=0?o+s:-1;for(o=e>0?s:a-1;o>=0&&o<a;o+=e)if(r[o]===i)return o;return-1}};b.indexOf=j(1,b.findIndex,b.sortedIndex),b.lastIndexOf=j(-1,b.findLastIndex),b.range=function(e,t,n){null==t&&(t=e||0,e=0),n||(n=t<e?-1:1);for(var r=Math.max(Math.ceil((t-e)/n),0),i=Array(r),o=0;o<r;o++,e+=n)i[o]=e;return i},b.chunk=function(e,t){if(null==t||t<1)return[];for(var n=[],r=0,i=e.length;r<i;)n.push(d.call(e,r,r+=t));return n};var N=function(e,t,n,r,i){if(!(r instanceof t))return e.apply(n,i);var o=w(e.prototype),s=e.apply(o,i);return b.isObject(s)?s:o};b.bind=S(function(e,t,n){if(!b.isFunction(e))throw new TypeError("Bind must be called on a function");var r=S(function(i){return N(e,r,t,this,n.concat(i))});return r}),b.partial=S(function(e,t){var n=b.partial.placeholder,r=function(){for(var i=0,o=t.length,s=Array(o),a=0;a<o;a++)s[a]=t[a]===n?arguments[i++]:t[a];for(;i<arguments.length;)s.push(arguments[i++]);return N(e,r,this,this,s)};return r}),b.partial.placeholder=b,b.bindAll=S(function(e,t){var n=(t=A(t,!1,!1)).length;if(n<1)throw new Error("bindAll must be passed function names");for(;n--;){var r=t[n];e[r]=b.bind(e[r],e)}}),b.memoize=function(e,t){var n=function(r){var i=n.cache,o=""+(t?t.apply(this,arguments):r);return C(i,o)||(i[o]=e.apply(this,arguments)),i[o]};return n.cache={},n},b.delay=S(function(e,t,n){return setTimeout(function(){return e.apply(null,n)},t)}),b.defer=b.partial(b.delay,b,1),b.throttle=function(e,t,n){var r,i,o,s,a=0;n||(n={});var c=function(){a=!1===n.leading?0:b.now(),r=null,s=e.apply(i,o),r||(i=o=null)},u=function(){var u=b.now();a||!1!==n.leading||(a=u);var d=t-(u-a);return i=this,o=arguments,d<=0||d>t?(r&&(clearTimeout(r),r=null),a=u,s=e.apply(i,o),r||(i=o=null)):r||!1===n.trailing||(r=setTimeout(c,d)),s};return u.cancel=function(){clearTimeout(r),a=0,r=i=o=null},u},b.debounce=function(e,t,n){var r,i,o=function(t,n){r=null,n&&(i=e.apply(t,n))},s=S(function(s){if(r&&clearTimeout(r),n){var a=!r;r=setTimeout(o,t),a&&(i=e.apply(this,s))}else r=b.delay(o,t,this,s);return i});return s.cancel=function(){clearTimeout(r),r=null},s},b.wrap=function(e,t){return b.partial(t,e)},b.negate=function(e){return function(){return!e.apply(this,arguments)}},b.compose=function(){var e=arguments,t=e.length-1;return function(){for(var n=t,r=e[t].apply(this,arguments);n--;)r=e[n].call(this,r);return r}},b.after=function(e,t){return function(){if(--e<1)return t.apply(this,arguments)}},b.before=function(e,t){var n;return function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=null),n}},b.once=b.partial(b.before,2),b.restArguments=S;var D=!{toString:null}.propertyIsEnumerable("toString"),L=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],V=function(e,t){var n=L.length,r=e.constructor,i=b.isFunction(r)&&r.prototype||a,o="constructor";for(C(e,o)&&!b.contains(t,o)&&t.push(o);n--;)(o=L[n])in e&&e[o]!==i[o]&&!b.contains(t,o)&&t.push(o)};b.keys=function(e){if(!b.isObject(e))return[];if(h)return h(e);var t=[];for(var n in e)C(e,n)&&t.push(n);return D&&V(e,t),t},b.allKeys=function(e){if(!b.isObject(e))return[];var t=[];for(var n in e)t.push(n);return D&&V(e,t),t},b.values=function(e){for(var t=b.keys(e),n=t.length,r=Array(n),i=0;i<n;i++)r[i]=e[t[i]];return r},b.mapObject=function(e,t,n){t=y(t,n);for(var r=b.keys(e),i=r.length,o={},s=0;s<i;s++){var a=r[s];o[a]=t(e[a],a,e)}return o},b.pairs=function(e){for(var t=b.keys(e),n=t.length,r=Array(n),i=0;i<n;i++)r[i]=[t[i],e[t[i]]];return r},b.invert=function(e){for(var t={},n=b.keys(e),r=0,i=n.length;r<i;r++)t[e[n[r]]]=n[r];return t},b.functions=b.methods=function(e){var t=[];for(var n in e)b.isFunction(e[n])&&t.push(n);return t.sort()};var F=function(e,t){return function(n){var r=arguments.length;if(t&&(n=Object(n)),r<2||null==n)return n;for(var i=1;i<r;i++)for(var o=arguments[i],s=e(o),a=s.length,c=0;c<a;c++){var u=s[c];t&&void 0!==n[u]||(n[u]=o[u])}return n}};b.extend=F(b.allKeys),b.extendOwn=b.assign=F(b.keys),b.findKey=function(e,t,n){t=y(t,n);for(var r,i=b.keys(e),o=0,s=i.length;o<s;o++)if(t(e[r=i[o]],r,e))return r};var U,W,B=function(e,t,n){return t in n};b.pick=S(function(e,t){var n={},r=t[0];if(null==e)return n;b.isFunction(r)?(t.length>1&&(r=_(r,t[1])),t=b.allKeys(e)):(r=B,t=A(t,!1,!1),e=Object(e));for(var i=0,o=t.length;i<o;i++){var s=t[i],a=e[s];r(a,s,e)&&(n[s]=a)}return n}),b.omit=S(function(e,t){var n,r=t[0];return b.isFunction(r)?(r=b.negate(r),t.length>1&&(n=t[1])):(t=b.map(A(t,!1,!1),String),r=function(e,n){return!b.contains(t,n)}),b.pick(e,r,n)}),b.defaults=F(b.allKeys,!0),b.create=function(e,t){var n=w(e);return t&&b.extendOwn(n,t),n},b.clone=function(e){return b.isObject(e)?b.isArray(e)?e.slice():b.extend({},e):e},b.tap=function(e,t){return t(e),e},b.isMatch=function(e,t){var n=b.keys(t),r=n.length;if(null==e)return!r;for(var i=Object(e),o=0;o<r;o++){var s=n[o];if(t[s]!==i[s]||!(s in i))return!1}return!0},U=function(e,t,n,r){if(e===t)return 0!==e||1/e==1/t;if(null==e||null==t)return!1;if(e!=e)return t!=t;var i=typeof e;return("function"===i||"object"===i||"object"==typeof t)&&W(e,t,n,r)},W=function(e,t,n,r){e instanceof b&&(e=e._wrapped),t instanceof b&&(t=t._wrapped);var i=l.call(e);if(i!==l.call(t))return!1;switch(i){case"[object RegExp]":case"[object String]":return""+e==""+t;case"[object Number]":return+e!=+e?+t!=+t:0==+e?1/+e==1/t:+e==+t;case"[object Date]":case"[object Boolean]":return+e==+t;case"[object Symbol]":return c.valueOf.call(e)===c.valueOf.call(t)}var o="[object Array]"===i;if(!o){if("object"!=typeof e||"object"!=typeof t)return!1;var s=e.constructor,a=t.constructor;if(s!==a&&!(b.isFunction(s)&&s instanceof s&&b.isFunction(a)&&a instanceof a)&&"constructor"in e&&"constructor"in t)return!1}r=r||[];for(var u=(n=n||[]).length;u--;)if(n[u]===e)return r[u]===t;if(n.push(e),r.push(t),o){if((u=e.length)!==t.length)return!1;for(;u--;)if(!U(e[u],t[u],n,r))return!1}else{var d,f=b.keys(e);if(u=f.length,b.keys(t).length!==u)return!1;for(;u--;)if(d=f[u],!C(t,d)||!U(e[d],t[d],n,r))return!1}return n.pop(),r.pop(),!0},b.isEqual=function(e,t){return U(e,t)},b.isEmpty=function(e){return null==e||(R(e)&&(b.isArray(e)||b.isString(e)||b.isArguments(e))?0===e.length:0===b.keys(e).length)},b.isElement=function(e){return!(!e||1!==e.nodeType)},b.isArray=p||function(e){return"[object Array]"===l.call(e)},b.isObject=function(e){var t=typeof e;return"function"===t||"object"===t&&!!e},b.each(["Arguments","Function","String","Number","Date","RegExp","Error","Symbol","Map","WeakMap","Set","WeakSet"],function(e){b["is"+e]=function(t){return l.call(t)==="[object "+e+"]"}}),b.isArguments(arguments)||(b.isArguments=function(e){return C(e,"callee")});var z=i.document&&i.document.childNodes;"function"!=typeof/./&&"object"!=typeof Int8Array&&"function"!=typeof z&&(b.isFunction=function(e){return"function"==typeof e||!1}),b.isFinite=function(e){return!b.isSymbol(e)&&isFinite(e)&&!isNaN(parseFloat(e))},b.isNaN=function(e){return b.isNumber(e)&&isNaN(e)},b.isBoolean=function(e){return!0===e||!1===e||"[object Boolean]"===l.call(e)},b.isNull=function(e){return null===e},b.isUndefined=function(e){return void 0===e},b.has=function(e,t){if(!b.isArray(t))return C(e,t);for(var n=t.length,r=0;r<n;r++){var i=t[r];if(null==e||!f.call(e,i))return!1;e=e[i]}return!!n},b.noConflict=function(){return i._=o,this},b.identity=function(e){return e},b.constant=function(e){return function(){return e}},b.noop=function(){},b.property=function(e){return b.isArray(e)?function(t){return E(t,e)}:x(e)},b.propertyOf=function(e){return null==e?function(){}:function(t){return b.isArray(t)?E(e,t):e[t]}},b.matcher=b.matches=function(e){return e=b.extendOwn({},e),function(t){return b.isMatch(t,e)}},b.times=function(e,t,n){var r=Array(Math.max(0,e));t=_(t,n,1);for(var i=0;i<e;i++)r[i]=t(i);return r},b.random=function(e,t){return null==t&&(t=e,e=0),e+Math.floor(Math.random()*(t-e+1))},b.now=Date.now||function(){return(new Date).getTime()};var $={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},q=b.invert($),G=function(e){var t=function(t){return e[t]},n="(?:"+b.keys(e).join("|")+")",r=RegExp(n),i=RegExp(n,"g");return function(e){return e=null==e?"":""+e,r.test(e)?e.replace(i,t):e}};b.escape=G($),b.unescape=G(q),b.result=function(e,t,n){b.isArray(t)||(t=[t]);var r=t.length;if(!r)return b.isFunction(n)?n.call(e):n;for(var i=0;i<r;i++){var o=null==e?void 0:e[t[i]];void 0===o&&(o=n,i=r),e=b.isFunction(o)?o.call(e):o}return e};var H=0;b.uniqueId=function(e){var t=++H+"";return e?e+t:t},b.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var Y=/(.)^/,J={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},K=/\\|'|\r|\n|\u2028|\u2029/g,X=function(e){return"\\"+J[e]};b.template=function(e,t,n){!t&&n&&(t=n),t=b.defaults({},t,b.templateSettings);var r,i=RegExp([(t.escape||Y).source,(t.interpolate||Y).source,(t.evaluate||Y).source].join("|")+"|$","g"),o=0,s="__p+='";e.replace(i,function(t,n,r,i,a){return s+=e.slice(o,a).replace(K,X),o=a+t.length,n?s+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":r?s+="'+\n((__t=("+r+"))==null?'':__t)+\n'":i&&(s+="';\n"+i+"\n__p+='"),t}),s+="';\n",t.variable||(s="with(obj||{}){\n"+s+"}\n"),s="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+s+"return __p;\n";try{r=new Function(t.variable||"obj","_",s)}catch(u){throw u.source=s,u}var a=function(e){return r.call(this,e,b)},c=t.variable||"obj";return a.source="function("+c+"){\n"+s+"}",a},b.chain=function(e){var t=b(e);return t._chain=!0,t};var Z=function(e,t){return e._chain?b(t).chain():t};b.mixin=function(e){return b.each(b.functions(e),function(t){var n=b[t]=e[t];b.prototype[t]=function(){var e=[this._wrapped];return u.apply(e,arguments),Z(this,n.apply(b,e))}}),b},b.mixin(b),b.each(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var t=s[e];b.prototype[e]=function(){var n=this._wrapped;return t.apply(n,arguments),"shift"!==e&&"splice"!==e||0!==n.length||delete n[0],Z(this,n)}}),b.each(["concat","join","slice"],function(e){var t=s[e];b.prototype[e]=function(){return Z(this,t.apply(this._wrapped,arguments))}}),b.prototype.value=function(){return this._wrapped},b.prototype.valueOf=b.prototype.toJSON=b.prototype.value,b.prototype.toString=function(){return String(this._wrapped)},void 0===(r=function(){return b}.apply(t,[]))||(n.exports=r)}()}).call(this,n(18),n(19)(e))},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(r){"object"==typeof window&&(n=window)}e.exports=n},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,n){var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=n(15),o=i.tagLogger("Sess"),s=n(21),a=0,c=i.prototypeExtend({setSessId:function(e){return e&&(this.sessId=e),this},setOp:function(e){return e&&(this.op=e),200===e&&(this.res={type:emedia.config.clientType,ver:emedia.config.version,agent:emedia.config.userAgent,ops:emedia.config.acptOps}),this},setTsxId:function(e){return e&&(this.tsxId=e),this},setTicket:function(e){return e&&(this.tkt=e),this},setSdp:function(e){return e&&(this.sdp=e),this},setCands:function(e){return e&&(this.cands=e),this},setSubSId:function(e){return e&&(this.subSId=e),this},setMemId:function(e){return e&&(this.memId=e),this},setPubS:function(e){e&&(this.pubS=i.extend(!1,{},e));var t=this.pubS;return t.ext&&i.isPlainObject(t.ext)&&(t.ext=JSON.stringify(t.ext)),t&&i.forEach(t,function(e,n){(i.isPlainObject(n)||"function"==typeof n)&&i.removeAttribute(t,e)}),t&&i.removeAttribute(t,"localStream"),t&&i.removeAttribute(t,"_localMediaStream"),t&&i.removeAttribute(t,"_webrtc"),this},setRtcId:function(e){return e&&(this.rtcId=e),this},setCver:function(e){return e&&(this.cver=e),this},setEndReason:function(e){return e&&(this.endReason=e),this},setNickName:function(e){return e&&(this.nickName=e),this},setResource:function(e){return e&&(this.resource=e),this},setReason:function(e){return e&&(this.reason=e),this},setConfrId:function(e){return e&&(this.confrId=e),this},setVoff:function(e){return void 0===e||(this.voff=e?1:0),this},setAoff:function(e){return void 0===e||(this.aoff=e?1:0),this},setFlag:function(e){return 0===e&&(this.flag=0),1===e&&(this.flag=1),this},setExt:function(e){return e&&i.isPlainObject(e)&&(e=JSON.stringify(e)),e&&(this.ext=e),this}}),u=emedia.__session_globalCount=0;e.exports=i.prototypeExtend({_events:{0:"onReqP2P",1:"onNewCfr",2:"onDelCfr",3:"onReqTkt",100:"onPing",101:"onPong",102:"onInitC",103:"onReqC",104:"onAcptC",105:"onTcklC",106:"onAnsC",107:"onTermC",300:"onEnter",301:"onExit",302:"onPub",303:"onUnpub",304:"onMems",204:"onClose",400:"onStreamControl",401:"onJoin",412:"onRoleUpdate",1002:"onRemoteControl",1003:"onRecvRemoteMessage"},__init__:function(){var e=this;e._bufferedMessages=[],e._callbacks={},navigator.onLine?e.online=!0:e.online=!1,window.addEventListener("online",function(t){e.online=!0,o.warn("online online online"),e.closed||e._reconnect(emedia.config.reconnect)},!0),window.addEventListener("offline",function(t){e.online=!1,o.warn("offline offline offline"),e.__checkConnectIntervalId&&clearTimeout(e.__checkConnectIntervalId),e.__retryConnectIntervalId&&clearTimeout(e.__retryConnectIntervalId),e.__retryConnectIntervalId&&delete e.__retryConnectIntervalId,e._websocket&&e._websocket.close(1e3)},!0),o.info("online status = ",e.online)},_nextWsUri:function(){var e=this.ticket.url;if("function"==typeof emedia.convertWebsocketURLOfTicket){var t=e;e=emedia.convertWebsocketURLOfTicket(e),o.warn(t,"--\x3e",e)}if(e.startsWith("/")){if(emedia.config.wsorigin)e=emedia.config.wsorigin+e;else{var n=window.location.href,r=n.startsWith("https")?"wss://":"ws://",i=n.indexOf("://")+3,s=n.indexOf("/",i);e=r+n.substring(i,s)+e}o.warn("websocket url. update. {} -> {}",this.ticket.url,e)}else emedia.config.wsorigin&&o.warn("emedia.config.wsorigin invalidate. causeby server url {}",e);return e.indexOf("?")>=0?e+="&"+a++:e+="?"+a++,this.ticket.confrId&&(e+="&"+encodeURIComponent(this.ticket.confrId)),e},_reconnect:function(e){var t=this;function n(){o.warn("Reconnected. at ",e,t._websocket.url),t.__retryConnectIntervalId&&clearTimeout(t.__retryConnectIntervalId),t.__retryConnectIntervalId&&delete t.__retryConnectIntervalId;var n=t.newMessage().setOp(200).setSessId(t._sessionId).setTicket(t.ticket).setNickName(t.nickName||t.ticket.memName).setResource(t.resource).setExt(t.owner.ext);t.postMessage(n,function(e){if(0==e.result)t.onEvent(new s.EnterSuccess),t.owner.onMembers(e.cver,e.mems),t.owner.onStreams(e.cver,e.streams),t.notifyNewMessage();else try{t.onEvent(new s.EnterFail({me:t.owner,cause:new s.RspFail({request:n,response:e})}))}finally{-9527!==e.result&&t.onEvent(new s.ServerRefuseEnter({failed:e.result,msg:e.msg}))}})}t.connect(n,function r(i){if(e<=0)return o.warn("Reconnect end. but fail.",i.url,e),void(t.__retryConnectIntervalId&&delete t.__retryConnectIntervalId);e&&(t.__retryConnectIntervalId=setTimeout(function(){t.connect(n,r,--e)},emedia.config.reconnectDelay))},--e)},__checkConnect:function(){var e=this;e.__checkConnectIntervalId&&clearTimeout(e.__checkConnectIntervalId),emedia.config.checkConnectIntervalMillis&&(e.__checkConnectIntervalId=setTimeout(function(){try{e.online&&!e.connected()&&(e.__retryConnectIntervalId&&o.debug("online, reconnecting..."),e.__retryConnectIntervalId||o.debug("online, but disconnect. will reconnect"),e.__retryConnectIntervalId||e._reconnect(emedia.config.reconnect))}finally{e.__checkConnect()}},emedia.config.checkConnectIntervalMillis))},connect:function(e,t,n){var r=this,a=r.thisWsUri=r._nextWsUri();void 0!==n&&o.warn("begin connect... at retry = ",n,a),function(e,t,n){var r=this;function a(e,i){try{r.onWebsocketEvent(new s.WSClose({url:r.thisWsUri,retry:n,online:r.online,cause:e,event:i,session:r}))}finally{t&&t(new s.WSClose({url:r.thisWsUri,retry:n,online:r.online,cause:e,event:i,session:r}))}}function u(e){if(r.connected(r.thisWsUri)){if(i.isPlainObject(e)&&!(e instanceof c))throw o.error("message not a Messages"),"message not a Messages";r.sessId&&e.sessId!=r.sessId?o.warn("self.sessId && message.sessId != self.sessId",e):(r.thisWsUri===r._websocket.url&&r._websocket.send(JSON.stringify(e)),r.thisWsUri===r._websocket.url&&o.debug("Done send: req:",e,r._websocket.url),r.thisWsUri===r._websocket.url||o.debug("Donot send(url not equal): req:",e,r._websocket.url))}else o.debug("current dont connect. the message = ",e)}if(r.connected(r.thisWsUri))return e&&e(r),o.info("Session connected. dont continue connect"),void(r.notifyNewMessage&&r.notifyNewMessage());if(r.online){r.notifyNewMessage=function(){if(r.connected(r.thisWsUri)){if(0===r._bufferedMessages.length)return;for(var e,t=[];e=r._bufferedMessages.shift();)if(e.sessId||r.sessId||200==e.op){if(200===e.op){u(e);break}r.sessId&&!e.sessId&&(e.sessId=r.sessId);var s=u(e);s&&t.push(s)}else t.push(e),o.warn("tmp store message, util enter success!",e);t.length>0&&Array.prototype.push.apply(r._bufferedMessages,t)}else if(0!==n&&r.online)r.connected();else{var a=i.extend(!1,{},r._callbacks),c=[];for(var d in a){var l=a[d];n>0&&!r.online?c.push(l):r.onMessage({op:1001,tsxId:d,result:-9527,msg:"sdk rsp fail. retry fail or online = "+r.online})}r._bufferedMessages=r._bufferedMessages||[],c.length>0&&Array.prototype.push.apply(r._bufferedMessages,c)}},o.info("Session begin connect.");var d=r._websocket;d&&(o.warn("will close. websocket state",d.readyState,d.url,r.thisWsUri),d.close(1e3));try{o.info("Connecting",r.thisWsUri,n),d=r._websocket=new WebSocket(r.thisWsUri)}catch(l){return o.warn(l),void a(l)}d.onopen=function(n){var i=this.url;if(i===r.thisWsUri)try{o.info("websocket connected:",i),t&&(t=null),e&&e(r),r.onWebsocketEvent(new s.WSConnected({event:n,session:r}))}finally{}else o.warn("ignore the onopen. caused by websocket url not ",r.thisWsUri,i)},d.onmessage=function(e){var t=this.url;if(t===r.thisWsUri){o.debug("recv data",e.data);var n=JSON.parse(e.data);n&&1001==n.op&&o.debug("recv message: rsp:",n),n&&1001!=n.op&&o.debug("recv message: evt:",n),r.onMessage(n)}else o.warn("ignore recv data. caused by websocket url not ",r.thisWsUri,t,e.data)},d.onclose=function(e){var t=this.url;o.info("Disconnected:",t,r.thisWsUri,e),t===r.thisWsUri?(r.notifyNewMessage(),1e3!==e.code&&a(void 0,e)):o.warn("ignore onclose. caused by websocket url not ",r.thisWsUri,t)},d.onerror=function(e){o.info("On error:",e),r.onWebsocketEvent(new s.WSError({event:e,online:r.online,session:r,url:this.url}))}}else a()}.call(r,function(){try{e.apply(r,arguments)}finally{r.__checkConnect()}},function(e){try{t.apply(r,arguments)}finally{n||e.url!==a||r.onEvent(new s.ServerRefuseEnter({failed:-95270,msg:"sdk reconnect fail. "+a+"|"+e.url}))}},n)},connected:function(e){return this.online&&this._websocket&&(!e||e===this._websocket.url)&&this._websocket.readyState==WebSocket.OPEN},onWebsocketEvent:function(e){this.onEvent(e)},register:function(e){if("object"===(void 0===e?"undefined":r(e)))for(var t in e)this.bind(t,e[t])},bind:function(e,t){var n;if(!(n=this._events[e]))throw o.error("Not supported event = ",e),"Not supported event = "+e;this[n]=t},getSessionId:function(){return this._sessionId},newMessage:function(e){return new c(e)},__modifyMessage:function(e){if(e&&e.sdp&&("string"==typeof e.sdp&&(e.sdp=i.parseJSON(e.sdp)),e.sdp.type&&(e.sdp.type=e.sdp.type.toLowerCase()),e.cctx&&(e.sdp.cctx=e.cctx)),e&&e.cands){"string"==typeof e.cands&&(e.cands=i.parseJSON(e.cands));for(var t=0;t<e.cands.length;t++)"string"==typeof e.cands[t]&&(e.cands[t]=i.parseJSON(e.cands[t])),e.cands[t].sdpMLineIndex=e.cands[t].mlineindex,e.cands[t].sdpMid=e.cands[t].mid,delete e.cands[t].mlineindex,delete e.cands[t].mid,e.cctx&&(e.cands[t].cctx=e.cctx)}if(e&&e.mems){if(!i.isArray(e.mems))return;var n=e.mems;e.mems={},i.forEach(n,function(t,n){n.name&&(n.memName=n.name),e.mems[n.id]=n;var r=n.acptOps={};if(i.forEach(emedia.config.baseAcptOps,function(e,t){r[t]=!0}),n.res&&i.forEach(n.res.ops,function(e,t){r[t]=!0}),n&&n.ext)try{e.mems[n.id].ext=JSON.parse(n.ext)}catch(s){o.debug(s)}})}if(e&&e.mem){e.mem.name&&(e.mem.memName=e.mem.name);var r=e.mem.acptOps={};if(i.forEach(emedia.config.baseAcptOps,function(e,t){r[t]=!0}),e.mem.res&&i.forEach(e.mem.res.ops,function(e,t){r[t]=!0}),e.mem&&e.mem.ext)try{e.mem.ext=JSON.parse(e.mem.ext)}catch(a){o.debug(a)}}if(e&&e.streams){if(!i.isArray(e.streams))return;var s=e.streams;e.streams={},i.forEach(s,function(t,n){if(e.streams[n.id]=n,n&&n.ext)try{e.streams[n.id].ext=JSON.parse(n.ext)}catch(a){o.debug(a)}})}if(e&&e.pubS&&e.pubS&&e.pubS.ext)try{e.pubS.ext=JSON.parse(e.pubS.ext)}catch(a){o.debug(a)}if(e&&e.ext)try{e.ext=JSON.parse(e.ext)}catch(a){o.debug(a)}return e},onMessage:function(e){var t=this;function n(e){var n,r=e.op;(n=t._events[r])&&(n=t[n])?n.call(t,e):o.warn("Not supported event = ",e)}if(1001!=e.op&&!e.sessId)throw o.error("message sessId error. server evt data error"),"message sessId error. server evt data error";if(1001!=e.op&&t._sessionId&&t._sessionId!=e.sessId)throw o.error("message sessId error. server and local not equal"),"message sessId error. server and local not equal";if(1004!==e.op){e=t.__modifyMessage(e);var r=i.removeAttribute(t._callbacks,e.tsxId);if(r&&200===r.op)if(t._sessionId=e.sessId,0===e.result){for(var a in t._bufferedMessages){var c=t._bufferedMessages[a];c.sessId||200===c.op||(c.sessId=e.sessId)}setTimeout(function(){t.notifyNewMessage()},100)}else for(var u;u=t._bufferedMessages.shift();)200!==u.op&&t.onMessage({op:1001,tsxId:u.tsxId,result:-9527,msg:"sdk enter fail. sdk callback. enter result = "+e.result});t.owner&&t.owner.closed?o.warn("self closed. me is "+t.owner.getMemberId()+", session_id = "+t.getSessionId()+". drop message",e):(t.onEvent(new s.RecvResponse({request:r,response:e})),r&&r.__callback__&&1004!==e.op?r.__callback__(e):e.op&&1001!=e.op?n(e):o.debug("Igron message. caused by op not found.",e))}else n(e)},__modifyMessageForPost:function(e){if(e.cands){for(var t=[],n=e.cands,r=0;r<n.length;r++){var o;0==r&&n[r].cctx&&(e.cctx=n[r].cctx),o="string"==typeof n[r]?{type:"candidate",candidate:n[r],mlineindex:0,mid:"audio"}:{type:"candidate",candidate:n[r].candidate,mlineindex:n[r].sdpMLineIndex,mid:n[r].sdpMid},t.push(JSON.stringify(o))}e.cands=t}if(e.sdp&&"string"!=typeof e.sdp){var s={type:e.sdp.type,sdp:e.sdp.sdp};e.sdp.cctx&&(e.cctx=e.sdp.cctx),e.sdp=s,e.sdp.type=e.sdp.type.toUpperCase(),e.sdp=i.stringifyJSON(e.sdp)}return e.pubS&&i.removeAttribute(e.pubS,"_located"),e.pubS&&i.removeAttribute(e.pubS,"mutedMuted"),e.pubS&&i.removeAttribute(e.pubS,"mediaStream"),e.pubS&&i.removeAttribute(e.pubS,"isRepublished"),e.pubS&&i.removeAttribute(e.pubS,"optimalVideoCodecs"),"function"==typeof e.post&&i.removeAttribute(e,"post"),e},postMessage:function(e,t,n){var r=this;if(e.tsxId||(e.tsxId="MSG"+Date.now()+"-"+u++),e.memId){var s=r.owner._cacheMembers[e.memId];if(!s)return o.warn("Member not found at local. memberId = "+e.memId,e),void(t&&t({op:1001,tsxId:e.tsxId,result:-507,msg:" member not found at local. memberId = "+e.memId}));var a=e._reqOps;for(var c in a||(a=[]).push(e.op),a){var d=a[c];if(!s.acptOps[d])return o.warn("Member not accept op "+d+", "+e.memId,e),void(t&&t({op:1001,tsxId:e.tsxId,result:-507,msg:" member not accept op "+d+", "+e.memId}))}}if(i.removeAttribute(e,"_reqOps"),r._sessionId&&r._sessionId!=e.sessId)return o.warn("sessionId not excepted. self._sessionId = "+r._sessionId,e),void(t&&t({op:1001,tsxId:e.tsxId,result:-9527,msg:"sessionId not excepted."}));if(r.closed)return o.warn("session closed.",e),void(t&&t({op:1001,tsxId:e.tsxId,result:-9527,msg:"session closed"}));var l=i.extend({},e);if(!(e=r.__modifyMessageForPost(e)))return o.warn("Message drop. callback success.",e),void(t&&t({op:1001,tsxId:l.tsxId,result:0,msg:"Message drop. callback success."}));200===e.op?(r._bufferedMessages.unshift(e),t&&setTimeout(function(){r._callbacks[e.tsxId]&&(o.error("Enter timeout. fail."),r.onMessage({op:1001,tsxId:e.tsxId,result:-9527,msg:"enter timeout. millis = "+emedia.config.enterTimeout}))},emedia.config.enterTimeout)):r._bufferedMessages.push(e),t&&(r._callbacks[e.tsxId]=i.extend(e,{__callback__:t.bind(r.owner)})),r.notifyNewMessage&&r.notifyNewMessage(),n&&t&&setTimeout(function(){var e=r._callbacks[e.tsxId];e&&e.__callback__&&e.__callback__({op:1001,tsxId:l.tsxId,result:-408,msg:"Message request timeout."}),i.removeAttribute(r._callbacks,e.tsxId)},n)},close:function(e){o.warn("sessiong closing, reason = ",e);this.notifyNewMessage&&this.notifyNewMessage(),this.closed=!0,this.seqno=0,this._websocket&&(0==e||100==e?this._websocket.close(1e3):this._websocket.close()),this.__retryConnectIntervalId&&clearTimeout(this.__retryConnectIntervalId),this.__retryConnectIntervalId&&delete this.__retryConnectIntervalId,this.__checkConnectIntervalId&&clearTimeout(this.__checkConnectIntervalId),this.__checkConnectIntervalId&&delete this.__checkConnectIntervalId,this.owner=null,this._bufferedMessages=[],this._callbacks={},o.warn("session closed")}})},function(e,t,n){var r=n(15),i=(r.logger,r.prototypeExtend({msg:"",__init__:function(){this.day=new Date},execTime:function(){var e=this.day.getHours();e<10&&(e="0"+e);var t=this.day.getMinutes();t<10&&(t="0"+t);var n=this.day.getSeconds();return n<10&&(n="0"+n),e+":"+t+":"+n}})),o=i.extend({_webrtcDesc:function(){this.webrtc;return this.webrtc.getRtcId()}});e.exports={Exception:i.extend(),WSClose:i.extend({message:function(){var e=this.execTime()+" WSClose: Websocket close ("+(this.retry||0)+").";return this.online||(e+=" offline."),this.event&&(e+=" wscode: "+this.event.code),this.cause&&(e+=" cause: "+this.cause.message),this.url&&(e+=" url: "+this.url),e+=" retry: "+(this.retry||0),this.session&&this.session.getSessionId()&&(e=e+", sess = "+this.session.getSessionId()),e}}),WSError:i.extend({message:function(){var e=this.execTime()+" WSError: Websocket error. ready state:"+(this.event.srcElement&&this.event.srcElement.readyState||this.event.currentTarget.readyState)+". online = "+this.online;return this.session&&this.session.getSessionId()&&(e=e+", sess = "+this.session.getSessionId()),this.url&&(e+=" url: "+this.url),e}}),WSConnected:i.extend({message:function(){var e=this.execTime()+" WSConnected: Websocket success. ready state:"+(this.event.srcElement&&this.event.srcElement.readyState||this.event.currentTarget.readyState);return this.session&&this.session.getSessionId()&&(e=e+", sess = "+this.session.getSessionId()),e}}),ICEChanage:o.extend({message:function(){return this.execTime()+" ICEChanage: "+this._webrtcDesc()+" state: "+this.state}}),AddIceCandError:o.extend({message:function(){return this.execTime()+" AddIceCandError: "+this._webrtcDesc()+", add cand error"}}),ICEConnectFail:o.extend({message:function(){return this.execTime()+" ICEConnectFail: "+this._webrtcDesc()+" failed"}}),ICEConnected:o.extend({message:function(){return this.execTime()+" ICEConnected: "+this._webrtcDesc()+" connected"}}),ICEDisconnected:o.extend({message:function(){return this.execTime()+" ICEDisconnected: "+this._webrtcDesc()+" disconnected"}}),ICEClosed:o.extend({message:function(){return this.execTime()+" ICEClosed: "+this._webrtcDesc()+" closed"}}),ICERemoteMediaStream:o.extend({message:function(){return this.execTime()+" ICERemoteMediaStream: "+this._webrtcDesc()+" got remote stream"}}),StreamState:i.extend({message:function(){return this.execTime()+" StreamState:  stream "+this.stream.id+" state: "+this.state+" "+this.msg},iceFail:function(){this.state=1,this.msg="network anomaly. media lost"}}),OpenMediaError:i.extend({message:function(){return this.execTime()+" OpenMediaError:  open media error. caused by "+this.event.toString()}}),Hangup:i.extend({message:function(){return this.self?"hangup id = "+(this.self.id||"--")+" reason："+(this.reason||0):this.execTime()+" Hangup: "+(this.parnter&&(this.parnter.name||this.parnter.id||" ")||"")+" hangup, reason："+(this.reason||0)}}),ServerRefuseEnter:i.extend({message:function(){return this.execTime()+" ServerRefuseEnter: server refuse, cause："+this.failed+", msg:"+(this.msg||"")}}),RspFail:i.extend({__init__:function(){this.day=new Date,this.failed=this.response.result,this.msg=this.response.msg||this.response.message||"--"},message:function(){return this.execTime()+" RspFail: "+this.request.tsxId+", "+(this.response.sessId||"--")+" op: "+this.request.op+", cause: "+this.failed+" "+this.msg}}),RecvResponse:i.extend({__init__:function(){this.day=new Date,this.failed=this.response.result,this.msg=this.response.msg},message:function(){return this.request?this.execTime()+" RecvResponse: "+(this.request&&this.request.tsxId)+", "+(this.response.sessId||"--")+" op: "+(this.request&&this.request.op)+", cause: "+this.failed+" "+this.msg:this.execTime()+" RecvMessage: "+(this.response&&this.response.tsxId)+", "+(this.response.sessId||"--")+" op: "+(this.response&&this.response.op)+" "+this.msg}}),EnterFail:i.extend({message:function(){return this.execTime()+" EnterFail: enter fail："+(this.cause?this.cause.message():"unkown")}}),EnterSuccess:i.extend({message:function(){return this.execTime()+" EnterSuccess: enter success"}}),PushSuccess:i.extend({message:function(){return this.execTime()+" PushSuccess: push success, streamId = "+this.stream.id+", "+this.stream.optimalVideoCodecs+", webrtc = "+this.stream.rtcId}}),PushFail:i.extend({message:function(){return this.execTime()+" PushFail: push fail, streamId = "+this.stream.id+", "+this.stream.optimalVideoCodecs+", webrtc = "+this.stream.rtcId+" cause："+(this.cause?this.cause.message?this.cause.message():this.cause:"unkown")}}),RemoteControlFail:i.extend({message:function(){return this.execTime()+" RemoteControlFail: "+(this.type||"remote control")+" fail, "+(this.stream?this.stream.id:"")+" failed = "+this.failed+" cause："+(this.cause?this.cause.message?this.cause.message():this.cause:"unkown")}}),SubSuccess:i.extend({message:function(){return this.execTime()+" SubSuccess: sub success, streamId = "+this.stream.id+", "+this.stream.vcodes+", webrtc = "+this.stream.rtcId}}),SubFail:i.extend({message:function(){return this.execTime()+" SubFail: sub fail, streamId = "+this.stream.id+", "+this.stream.vcodes+", webrtc = "+this.stream.rtcId+" cause："+(this.cause?this.cause.message?this.cause.message():this.cause:"unkown")}}),SubFailNotSupportVCodes:i.extend({message:function(){return this.execTime()+" SubFailNotSupportVCodes: sub fail, streamId = "+this.stream.id+" cause："+(this.cause?this.cause.message?this.cause.message():this.cause:"unkown")}}),SubFailSafariNotAllowSubBeforePub:i.extend({message:function(){return this.execTime()+" SubFailSafariNotAllowSubBeforePub: sub fail, streamId = "+this.stream.id+" cause：Safari without access to capture devices, WebKit only exposes Server Reflexive and TURN ICE candidates, which expose IPs that could already be gathered by websites."}}),SwitchVCodes:i.extend({message:function(){return this.execTime()+" SwitchVCodes: pub streamId = "+this.stream.id}}),CurrentCalling:i.extend({message:function(){return this.execTime()+" CurrentCalling: warn! current calling..."}}),OpenDesktopMedia:i.extend({message:function(){return this.execTime()+" OpenDesktopMedia: shared desktop, desktopStreamId = "+desktopStreamId}}),OpenDesktopMediaAccessDenied:i.extend({message:function(){return this.execTime()+" OpenDesktopMediaAccessDenied: shared desktop not allow"}}),ShareDesktopExtensionNotFound:i.extend({message:function(){return this.execTime()+" ShareDesktopExtensionNotFound: shared desktop plugin required"}}),OtherDeviceAnswer:i.extend({message:function(){return this.execTime()+" other device answer, webrtc = "+this.rtcId}}),AudioMixerStreamNotAllowSub:i.extend({message:function(){return this.execTime()+" audio mixer stream not allow sub, webrtc = "+this.rtcId+", streamId = "+this.stream.id}}),AudioMixerStreamNotAllowOnlySubVideo:i.extend({message:function(){return this.execTime()+" audio mixer stream not allow only sub video, webrtc = "+this.rtcId+", streamId = "+this.stream.id}}),AudioMixerStreamRepeatPublish:i.extend({message:function(){return this.execTime()+" audio mixer stream repeat publish"}})}},function(e,t,n){var r=n(15),i=r.tagLogger("Me"),o=n(23),s=n(21),a=n(26),c=o.extend({__init__:function(){if(this._session||this.sessionFactory&&(this._session=this.sessionFactory()),!this._session)throw i.error("Require session"),"Require session";this._cver=0,this._cacheMembers={},this._cacheStreams={},this._mediaMeters={},this._openedRtcMediaStreams={},this._linkedStreams={},this._maybeNotExistStreams={},this._records={},this._ices={},this.audioMixers={},this.closed=!1,this._nextStreamSeqno=0,this.getMediaMeterIntervalMillis=this.getMediaMeterIntervalMillis||emedia.config.getMediaMeterIntervalMillis},getCurrentMembers:function(){var e=[];return r.forEach(this._cacheMembers,function(t,n){var i=r.extend(!0,{},n);e.push(i)}),e},newStream:function(e){var t=this;return new a(e,{__init__:function(){if(this.rtcId||this._webrtc&&(this.rtcId=this._webrtc.getRtcId()),this._webrtc||this.rtcId&&(this._webrtc=t._ices[this.rtcId]),this.__create_id=t._nextStreamSeqno++,this.memId&&!this.owner&&(this.owner=r.extend({},t._cacheMembers[this.memId]),!this.owner&&!this.located()))throw i.error("Remote stream, not owner. it = ",this.id),"Remote stream, not owner. it = "+this.id}})},getConfrId:function(){return this.ticket.confrId},isCaller:function(){return this.isP2P()&&this.ticket.caller==this.ticket.memName},isCallee:function(){return this.isP2P()&&this.ticket.callee==this.ticket.memName},isP2P:function(){return this.ticket&&("P2P"==this.ticket.type||"p2p"==this.ticket.type)},isConfr:function(){return this.ticket&&("CONFR"==this.ticket.type||"confr"==this.ticket.type)},onEvent:function(e){},join:function(e,t){i.debug("begin join ...");var n,r=this;if(r._memberId)return i.warn("Had joined. igrone it"),void(e&&e(r.memId));function o(e){try{if(e instanceof s.WSClose&&e.retry)return;e instanceof s.EnterFail||(e=new s.EnterFail({attendee:r,cause:e})),r.onEvent(e),t&&t(e)}finally{}}function a(t){if(0==t.result){r.reflushSupportVCodes(t.vcodes),r.setMemberId(t.memId),r.role=t.role,r.onEvent(new s.EnterSuccess),e&&e(t.memId);try{r.__rtc_cfg=t.rtcCfg,"string"==typeof t.rtcCfg&&(r.__rtc_cfg=JSON.parse(t.rtcCfg))}finally{r.onMembers(t.cver,t.mems),r.onStreams(t.cver,t.streams)}}else try{o(new s.RspFail({request:n,response:t}))}finally{-9527!==t.result&&r.onEvent(new s.ServerRefuseEnter({failed:t.result,msg:t.msg}))}}r.connect(function(){n=r.newMessage().setOp(200).setTicket(r.ticket).setNickName(r.nickName||r.ticket.memName).setResource(r.resource).setExt(r.ext),r.postMessage(n,a)},o),i.debug("join",r.ticket.url)},withpublish:function(e){var t,n=this;if(!e||!e.localStream)throw i.error("pubS null or stream not open"),"pubS null or stream not open";var r,o=e&&e.localStream;return{join:function(a,c){if(1===arguments.length&&(c=a,a=void 0),n._memberId)return i.warn("Had joined. igrone it"),void(a&&a(n.memId));function u(e){try{if(e instanceof s.WSClose&&e.retry)return;e instanceof s.EnterFail||(e=new s.EnterFail({attendee:n,cause:e})),n.onEvent(e),c&&c(e)}finally{emedia.stopTracks(o),r&&n.closeWebrtc(r.getRtcId())}}var d=n.getOptimalVideoCodecs();function l(o){if(0==o.result){n.reflushSupportVCodes(o.vcodes),n.setMemberId(o.memId),n.role=o.role,n.onEvent(new s.EnterSuccess);var c=n.newStream(e);c._localMediaStream=e.localStream,c.rtcId=r.getRtcId(),c._webrtc=r,c.id=o.streamId,c.csrc=o.csrc,c.owner={id:o.memId,nickName:n.nickName,name:n.sysUserId,ext:n.extObj},c.optimalVideoCodecs=d,a&&a(o.memId,c),n.onEvent(new s.PushSuccess({stream:c,hidden:!0})),o.sdp&&n.ansC(r.getRtcId(),o.sdp),o.cands&&n.tcklC(r.getRtcId(),o.cands);try{n.__rtc_cfg=o.rtcCfg,"string"==typeof o.rtcCfg&&(n.__rtc_cfg=JSON.parse(o.rtcCfg)),n.__rtc_cfg&&n.__rtc_cfg.iceServers&&n.__rtc_cfg.iceServers.length>0&&(i.warn("Server rsp one rtc cfg. publish will republish"),n._service&&setTimeout(function(){n._service._republish(c)},200))}finally{n.onMembers(o.cver,o.mems),n.onStreams(o.cver,o.streams)}}else try{u(new s.RspFail({request:t,response:o}))}finally{-9527!==o.result&&n.onEvent(new s.ServerRefuseEnter({failed:o.result,msg:o.msg}))}}n.connect(function(){i.debug("enter and pubs");var o,s,a=e.localStream;2===e.type&&(o={offerToReceiveAudio:!0,offerToReceiveVideo:!1},s={subSVideo:!1,subSAudio:!0}),r=n.createWebrtc({_rtcId:e.rtcId,optimalVideoCodecs:d,offerOptions:o,subArgs:s,vbitrate:e.vbitrate||e.constaints&&e.constaints.video&&e.constaints.video.bitrate,abitrate:e.abitrate||e.constaints&&e.constaints.audio&&e.constaints.audio.bitrate},e.iceRebuildCount),n.setLocalStream(a,r.getRtcId()),n.doOffer(r.getRtcId(),function(i){t=n.newMessage().setOp(200).setTicket(n.ticket).setNickName(n.nickName||n.ticket.memName).setResource(n.resource).setSdp(i).setRtcId(r.getRtcId()).setPubS(e).setExt(n.ext),n.postMessage(t,l)})},u),i.debug("join",n.ticket.url)}}},push:function(e,t,n,r){i.debug("begin push ...");var o,a=this;if(2===arguments.length&&(n=t,t=void 0),!e||!e.localStream)throw i.error("pubS or stream open"),"pubS or stream open";var c,u=e.localStream;function d(t){try{var i=a.newStream(e);i._localMediaStream=e.localStream,i._webrtc=c,i.rtcId=c&&c.getRtcId(),i.owner={id:a.getMemberId(),nickName:a.nickName,name:a.sysUserId,ext:a.extObj};t=new s.PushFail({stream:i,cause:t,hidden:r&&!0===t.hidden});a.onEvent(t),t.hidden||n&&n(t)}finally{u&&!0!==t.hidden&&emedia.stopTracks(u),c&&a.closeWebrtc(c.getRtcId(),!0===t.hidden)}}if(e.rtcId||2!==e.type||emedia.config.allowRepeatAudioMixerPublish||!a._service.hasAudioMixers()){var l=e.optimalVideoCodecs||a.getOptimalVideoCodecs();!function(e){i.debug("pubs");var t,n,r=e.localStream;2===e.type&&(t={offerToReceiveAudio:!0,offerToReceiveVideo:!1},n={subSVideo:!1,subSAudio:!0}),c=a.createWebrtc({_rtcId:e.rtcId,optimalVideoCodecs:l,offerOptions:t,subArgs:n,vbitrate:e.vbitrate||e.constaints&&e.constaints.video&&e.constaints.video.bitrate,abitrate:e.abitrate||e.constaints&&e.constaints.audio&&e.constaints.audio.bitrate},e.iceRebuildCount),a.setLocalStream(r,c.getRtcId()),a.doOffer(c.getRtcId(),function(t){o=a.newMessage().setOp(102).setRtcId(c.getRtcId()).setSdp(t).setPubS(e),a.postMessage(o,function(e){f(c,e)})})}(e),i.debug("push",a.ticket.url)}else d(new s.AudioMixerStreamRepeatPublish);function f(n,r){if(0==r.result){var i=a.newStream(e);i._localMediaStream=e.localStream,i._webrtc=n,i.rtcId=n.getRtcId(),i.id=r.streamId,i.csrc=r.csrc,i.owner={id:a.getMemberId(),nickName:a.nickName,name:a.sysUserId,ext:a.extObj},i.optimalVideoCodecs=l,i.id&&2===i.type&&(a.audioMixers[i.id]=i);try{a.onEvent(new s.PushSuccess({stream:i,hidden:!0}))}finally{r.sdp&&a.ansC(n.getRtcId(),r.sdp),r.cands&&a.tcklC(n.getRtcId(),r.cands),t&&t(i)}}else d(new s.RspFail({request:o,response:r,hidden:!0===r.retrying}))}},isSafari:function(){return/Safari/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)},isSafariButNotPushStream:function(e,t){var n=this;return!(!n.isSafari()||emedia._isSafariYetPushedStream)&&(!0===n.__tryingOpenMedia?(n.__tryingOpenMediaWaitSuceess=n.__tryingOpenMediaWaitSuceess||[],n.__tryingOpenMediaWaitFail=n.__tryingOpenMediaWaitFail||[],"function"==typeof e&&n.__tryingOpenMediaWaitSuceess.push(e),"function"==typeof t&&n.__tryingOpenMediaWaitFail.push(t)):(n.__tryingOpenMedia=!0,n._service.__getUserMedia({audio:!0},function(t,i){emedia._isSafariYetPushedStream=!0,emedia.stopAudioTracks(i),setTimeout(function(){n.__tryingOpenMedia=!1,e&&e.apply(n),n.__tryingOpenMediaWaitSuceess&&r.forEach(n.__tryingOpenMediaWaitSuceess,function(e,t){t.apply(n)}),n.__tryingOpenMediaWaitSuceess=[],n.__tryingOpenMediaWaitFail=[]},300)},function(e){n.__tryingOpenMedia=!1,i.error("Safari must getUserMedia, gather cands. now try get audio. fail. subfail"),t&&t.call(n,e),n.__tryingOpenMediaWaitFail&&r.forEach(n.__tryingOpenMediaWaitFail,function(t,r){r.call(n,e)}),n.__tryingOpenMediaWaitSuceess=[],n.__tryingOpenMediaWaitFail=[]})),!0)},createWebrtcAndSubscribeStream:function(e,t,n,o){var a=this;t||(t={});var c=a._cacheStreams[e],u=a._cacheMembers[c.memId],d=c;function l(n){i.warn("sub stream error",e,n),v&&d._webrtc&&d._webrtc.setSubArgs(v),v&&(d.subArgs=v),n=new s.SubFail({stream:d,hidden:!0===n.hidden,cause:n}),t&&t.onEvent&&t.onEvent(n),a.onEvent&&a.onEvent(n)}o=o||d.subArgs||{subSVideo:!0,subSAudio:2!==c.type};var f=c.vcodes||[],p=u&&u.vcodes||[],h=a.supportVCodes,m=a._getOptimalVideoCodecsSubset(f,p,h);o=o||d.subArgs;var v=d.subArgs,b=!(d.vcodes&&d.vcodes.length>0);emedia.isSafari&&(b=b||!!d.voff);var g={offerToReceiveAudio:!0,offerToReceiveVideo:o.subSVideo&&!b};g.offerToReceiveAudio||g.offerToReceiveVideo||i.warn("offerToReceiveAudio == false and offerToReceiveVideo == false");var _=a.createWebrtc({iceServerConfig:n,optimalVideoCodecs:m,offerOptions:g,onGotMediaStream:function(e){var n=new s.SubSuccess({stream:d,hidden:!0});t.onGotRemote&&t.onGotRemote(d),a.onEvent&&a.onEvent(n)}},d.iceRebuildCount),y=_.getRtcId();i.warn(y," sub stream ",e,m),d._webrtc=_,d.rtcId=y,d.owner=r.extend({},u),o&&d._webrtc&&d._webrtc.setSubArgs(o),o&&(d.subArgs=o),a.isSafariButNotPushStream(function(){a.offerCall(y,null,e,l,function(){})},function(t){i.error("Safari must getUserMedia, gather cands. now try get audio. fail. subfail",y,e),l(t)})||a.offerCall(y,null,e,l,function(){})},_getOptimalVideoCodecsSubset:function(e,t,n){var i=this,o=[];if(e&&e.length>0&&n[e[0]]&&o.push(e[0]),0==o.length)for(var s=0;s<i._orderVCodes.length;s++)r.forEach(t,function(e,t){t==i._orderVCodes[s]&&o.push(t)});return o},subscribeStream:function(e,t,n,i,o){var a=this,c=a._ices[e],u=a._cacheStreams[t],d=a._cacheMembers[u.memId],l=u;l._webrtc=c,l.rtcId=e,l.owner=r.extend({},d);var f=l.subArgs;if(i=i||{subSVideo:!0,subSAudio:!0},l.subArgs=l.subArgs||{subSVideo:!0,subSAudio:!0},l._webrtc&&(l._webrtc.subArgs=l._webrtc.subArgs||{subSVideo:!0,subSAudio:!0}),!l.subArgs.subSVideo&&i.subSVideo&&!l.voff){var p=u.vcodes,h=d.vcodes,m=a.supportVCodes;a._getOptimalVideoCodecsSubset(p,h,m)}i&&l._webrtc&&l._webrtc.setSubArgs(i),i&&(l.subArgs=i);var v=a.newMessage().setOp(205).setRtcId(e).setSubSId(t);i&&r.extend(v,i),a.postMessage(v,function(e){if(0!=e.result){f&&l._webrtc&&l._webrtc.setSubArgs(f),f&&(l.subArgs=f);var t=new s.SubFail({stream:l,cause:new s.RspFail({request:v,response:e})});return n&&n(t),void a.onEvent(t)}t=new s.SubSuccess({stream:l,hidden:!0});a._updateRemoteStream(l,l._webrtc.getRemoteStream()),a.onEvent(t),"function"==typeof o&&o()})},unsubscribeStream:function(e){var t=this._cacheStreams[e],n=t._webrtc&&t._webrtc.getRtcId();if(n){try{var r=this.newMessage().setOp(206).setRtcId(n).setSubSId(e);this.postMessage(r)}finally{this.closeWebrtc(n)}return n}},onEnter:function(e,t){var n=this;if(e&&(n._cver=e),t&&!n._cacheMembers[t.id]){n._cacheMembers[t.id]=t;var i={};t.res&&t.res.vcodes&&t.res.vcodes.length>0&&r.forEach(t.res.vcodes,function(e,t){i[t]||(i[t]=!0,n.supportVCodes[t]&&n.supportVCodes[t]++)}),n.onAddMember(r.extend({},t))}},_onFinally:function(){this._cacheMembers={},this._cacheStreams={},this._linkedStreams={},this._ices={},this._maybeNotExistStreams={};var e=[];if(r.forEach(this._openedRtcMediaStreams,function(t,n){!1!==n.active&&e.push(n)}),e.length>0)for(var t=0;t<e.length;t++)try{var n=e[t];i.info("exit, close stream = ",n.id),emedia.stopTracks(n)}catch(o){i.error(o)}i.warn("finally. all clean.")},_onRoleUpdate:function(e,t){i.info("Role ",e," <-",this.role),i.info(t),this.role=e,this.roleToken=t,this.onRoleUpdate&&this.onRoleUpdate(e,t)},onExit:function(e,t,n){var o=this;if(e&&(o._cver=e),t!=o.getMemberId()){var a=o._cacheMembers[t];a&&(a.res&&a.res.vcodes&&a.res.vcodes.length>0&&r.forEach(a.res.vcodes,function(e,t){o.supportVCodes[t]--}),o._onRemoveMember(a,n),o.onEvent(new s.Hangup({reason:n,parnter:a})))}else{i.warn("Me exit. ",n,t);try{o.closed||o.close(n)}catch(c){o.onEvent(new s.Hangup({reason:n,self:{id:o._memberId}})),o.onMeExit&&o.onMeExit(n),i.warn(c)}}},onPub:function(e,t,n){if(!this._cacheMembers[t])throw i.error("No found member. when pub"),"No found member. when pub";var o=this.newStream(n),s=this._cacheStreams[n.id];if(e&&(this._cver=e),s&&o.sver!==s.sver)return i.info("Onpub. the steam ",s.id," republish. sver ",s.sver,o.sver),!o||o.aoff===s.aoff&&o.voff==s.voff||this.onStreamControl(void 0,n.id,o.voff,o.aoff),r.extend(s,o),void this._onRepublishStream(s);var a=o;return a.owner=this._cacheMembers[t],this._cacheStreams[n.id]=a,this._onAddStream(this.newStream(a)),this.autoSub&&this.createWebrtcAndSubscribeStream(n.id,{onGotRemote:function(e){}}),a},onUnpub:function(e,t,n){var r=this._cacheStreams[n];this._onRemovePubstream(this._cacheMembers[t],r),e&&(this._cver=e)},onClose:function(e,t,n){try{this.close(n||0)}finally{this.onConfrClose&&this.onConfrClose(t,n)}},__getWebrtcFor:function(e){var t=this._cacheStreams[e]&&this._cacheStreams[e]._webrtc;return t&&t.getRtcId()},_getWebrtc:function(e){return this._cacheStreams[e]&&this._cacheStreams[e]._webrtc},_updateRemoteStream:function(e,t){e.located()&&2===e.type?emedia.enableAudioTracks(t,!0):emedia.enableAudioTracks(t,!(e.aoff||e.subArgs&&!1===e.subArgs.subSAudio)),emedia.enableVideoTracks(t,!(e.voff||e.subArgs&&!1===e.subArgs.subSVideo))},onStreamControl:function(e,t,n,r,i){(s=this._cacheStreams[t]).voff=n,s.aoff=r;var o=s._webrtc;o&&o._remoteStream&&this._updateRemoteStream(s,o._remoteStream);var s=this.newStream(s);this.onUpdateStream&&this.onUpdateStream(s,new s.Update({voff:n,aoff:r})),e&&(this._cver=e),i&&(s.sver=i)},aoff:function(e,t,n){var r=this.__getWebrtcFor(e.id);if(!r)throw i.error("pubS not publish",e.id),"pubS not publish"+e.id;this._linkedStreams[e.id].aoff=e.aoff=t;var o=this.newMessage().setOp(400).setRtcId(r).setVoff(e.voff).setAoff(t);this.postMessage(o,n),this.onUpdateStream&&this.onUpdateStream(e,new e.Update({aoff:t}))},voff:function(e,t,n){var r=this.__getWebrtcFor(e.id);if(!r)throw i.error("pubS not publish",e.id),"pubS not publish"+e.id;this._linkedStreams[e.id].voff=e.voff=t;var o=this.newMessage().setOp(400).setRtcId(r).setVoff(t).setAoff(e.aoff);this.postMessage(o,n),this.onUpdateStream&&this.onUpdateStream(e,new e.Update({voff:t}))},startRecord:function(e,t){var n=this,o=e.rtcId,s=n.newMessage().setOp(500).setRtcId(o).setFlag(1);n.postMessage(s,function(s){i.warn("record ",o,s.result,s.msg),t&&t(0===s.result),0===s.result&&(n._records[e.id]=r.extend(!1,{},e))})},stopRecord:function(e,t){var n=e.rtcId,o=this.newMessage().setOp(500).setRtcId(n).setFlag(0);this.postMessage(o,function(e){i.warn("stop record ",n,e.result,e.msg),t&&t(0===e.result)}),this._records[e.id]&&r.removeAttribute(this._records,e.id)},onMembers:function(e,t){var n=this,i=[];r.forEach(n._cacheMembers,function(e,n){t[e]||i.push(n)}),r.forEach(i,function(e,t){n.onExit(void 0,t.id)});var o=[];r.forEach(t,function(e,t){e!=n.getMemberId()&&(n._cacheMembers[e]||o.push(t),n._cacheMembers[e]&&r.extend(n._cacheMembers[e],t))}),r.forEach(o,function(e,t){n.onEnter(void 0,t)}),e&&(n._cver=e)},onStreams:function(e,t){var n=this,i=[];r.forEach(n._cacheStreams,function(e,n){n.located()||t[e]||i.push(n)}),r.forEach(i,function(e,t){n.onUnpub(void 0,t.memId,t.id)});var o=[];r.forEach(t,function(e,t){t.memId!=n.getMemberId()&&(n._cacheStreams[e]||o.push(t),n._cacheStreams[e]&&r.extend(n._cacheStreams[e],t))}),r.forEach(o,function(e,t){n.onPub(void 0,t.memId,t)}),r.forEach(n._cacheStreams,function(e,i){var o;i.located()||(o=t[e]),!o||o.aoff===i.aoff&&o.voff==i.voff||n.onStreamControl(void 0,e,o.voff,o.aoff),o&&o.sver!==i.sver&&(r.extend(i,o),n._onRepublishStream(i))}),e&&(n._cver=e)},_onRemoveMember:function(e,t){var n=this;i.info("remove",e,t);var o=[];r.forEach(n._cacheStreams,function(t,n){(n.memId||n.owner&&n.owner.id)===e.id&&o.push(n)}),r.forEach(o,function(e,r){n._onRemovePubstream(r.owner,r,t)}),r.removeAttribute(n._cacheMembers,e.id),n.onRemoveMember&&n.onRemoveMember(e,t)},_onAddStream:function(e){i.info("add stream ",e.id),i.debug("add stream ",e);this.onAddStream(e)},_onRemovePubstream:function(e,t){var n=this;if(t&&0!=t.id)try{var i=r.removeAttribute(n._mediaMeters,t.id);i&&i._finally()}finally{!function(e){2===e.type&&(r.removeAttribute(n.audioMixers,e.id),e.remotePlayAudioObject&&document.body.removeChild(e.remotePlayAudioObject)),n.unsubscribeStream(e.id),r.removeAttribute(n._cacheStreams,e.id),n._monitSoundChanagedStreams&&r.removeAttribute(n._monitSoundChanagedStreams,e.id),n.onRemoveStream&&(e=n.newStream(e),n.onRemoveStream(e))}(t)}},_onRepublishStream:function(e){if(!this._ices[e.rtcId]&&!emedia.subscribed(e)||this._maybeNotExistStreams[e.id])this.onUpdateStream(e);else{this.unsubscribeStream(e.id);this.createWebrtcAndSubscribeStream(e.id,{onGotRemote:function(e){}})}},_onRecvRemoteMessage:function(e,t,n){i.debug("Recv remote message",e,t);var r,o=this._cacheMembers[e];try{r=JSON.parse(t)}catch(s){}this.onRecvRemoteMessage&&this.onRecvRemoteMessage(o||e,r||t,n)},_onSoundChanage:function(e,t,n){emedia.config._printSoundData&&i.info("Stream id "+t.id+", meter "+(n&&n.instant.toFixed(2)+" "+n.slow.toFixed(2)+" "+n.clip.toFixed(2)+" "+(n.trackAudioLevel||"--")+" "+(n.trackTotalAudioEnergy||"--"))),n||(n={instant:0,slow:0,clip:0});0===n.instant&&(n.instant=n.trackAudioLevel||n.trackTotalAudioEnergy||0),this.onSoundChanage(e,t,n),this._service._judgeTalking(n)&&this.onTalking(e,t,n)},onAddMember:function(e){},onRemoveMember:function(e,t){},onAddStream:function(e){},onRemoveStream:function(e){},onUpdateStream:function(e,t){},onRecvRemoteMessage:function(e,t){},onSoundChanage:function(e,t,n){},onTalking:function(e,t,n){}});e.exports=c},function(e,t,n){var r=n(15),i=r.tagLogger("Member"),o=n(21),s=n(24);e.exports=r.prototypeExtend({__init__:function(){if(!this._session)throw i.error("Require session"),"Require session";this.closed=!1,this._ices={},this.supportVCodes={},this.audioMixers={}},reflushSupportVCodes:function(e){var t=this;t.supportVCodes={},t._orderVCodes=e,e&&0!=e.length?r.forEach(e,function(e,n){t.supportVCodes[n]=1}):i.warn("Not config support vcodes")},getOptimalVideoCodecs:function(){if(!this._orderVCodes||0==this._orderVCodes.length)return/Chrome/.test(navigator.userAgent)?"VP8":/Safari/.test(navigator.userAgent)?"H264":"VP8";var e=0;r.forEach(this._cacheMembers,function(){e++});for(var t,n=0,i=0;i<this._orderVCodes.length;i++){var o=this._orderVCodes[i];if(0==n&&(n=this.supportVCodes[o]),this.supportVCodes[o]>e)return o;this.supportVCodes[o]>n&&(n=this.supportVCodes[o],t=o)}return t},setMemberId:function(e){this._memberId=e},getMemberId:function(){return this._memberId||this.id},createWebrtc:function(e,t){var n=this;e||(e={}),r.extend(e,{_rebuildCount:t||0}),!0===n._service.useRTCCfg&&n.__rtc_cfg?e.iceServerConfig=r.extend(!0,{},n.__rtc_cfg):r.isPlainObject(n._service.useRTCCfg)&&(e.iceServerConfig=r.extend(!0,{},n._service.useRTCCfg));var a=new s({onIceStateChange:function(e){var t=e;i.debug("evt.target ice state",t);try{if("failed"==t)return n.onEvent(new o.ICEConnectFail({webrtc:a})),void(a.onEvent&&a.onEvent(new o.ICEConnectFail({webrtc:a})));if("connected"==t)return n.onEvent(new o.ICEConnected({webrtc:a})),void(a.onEvent=null);if("closed"==t)return n.onEvent(new o.ICEClosed({webrtc:a})),void(a.onEvent&&a.onEvent(new o.ICEClosed({webrtc:a})));if("disconnected"==t)return n.onEvent(new o.ICEDisconnected({webrtc:a})),void(a.onEvent&&a.onEvent(new o.ICEDisconnected({webrtc:a})))}finally{n._onIceStateChange&&n._onIceStateChange(a,e)}},onIceCandidate:function(e){n._onIceCandidate&&e&&n._onIceCandidate(a,e)},onGotRemoteStream:function(e){i.info("got stream.",a,e),a.onGotMediaStream&&a.onGotMediaStream(e),n.onEvent(new o.ICERemoteMediaStream({webrtc:a}))},onAddIceCandidateError:function(e){n.onEvent(new o.AddIceCandError({webrtc:a,event:e}))},onSetSessionDescriptionError:function(e){i.warn("onSetSessionDescriptionError : Failed to set session description: "+e.toString()),n.onEvent&&n.onEvent(new o.ICEConnectFail({webrtc:a,event:e}))},onCreateSessionDescriptionError:function(e){i.warn("Failed to create session description: "+e.toString()),n.onEvent&&n.onEvent(new o.ICEConnectFail({webrtc:a,event:e}))}},e);return n._ices||(n._ices={}),n._ices[a.getRtcId()]&&n._howDoWebrtcWhenCrtExsitsWebrtc(a),n._ices[a.getRtcId()]=a,n._ices[a.__id]=a,n._iceCreateRtcPeerConnection(a.getRtcId()),i.debug("create rtc ",a),a},_howDoWebrtcWhenCrtExsitsWebrtc:function(e){this.closeWebrtc(e.getRtcId(),!0,!1)},connect:function(e,t){this._session.connect(e,t)},connected:function(){return this._session.connected()},newMessage:function(e){var t=this,n=t._session.newMessage(e);return n.post=function(e,n){t.postMessage(this,e,n)},n},message:function(e){var t=this,n=t._session.newMessage(e);return n.post=function(e,n){t.postMessage(this,e,n)},n},postMessage:function(e,t,n){try{e.sessId||(e.sessId=this._session._sessionId),this._session.postMessage(e,t,n)}catch(r){t&&t({op:1001,tsxId:e.tsxId,result:-9527,msg:"post message. exception"}),i.warn(r)}},onEvent:function(e){},_onIceStateChange:function(e,t){i.info(e.getRtcId(),t),this.onEvent(new o.ICEChanage({webrtc:e,state:t}))},_onIceCandidate:function(e,t){var n,i=this;r.isArray(t)?n=t:(n=[]).push(t);var s=i.newMessage().setOp(105).setRtcId(e.getRtcId()).setCands(n);i.postMessage(s,function(e){0==e.result||i.onEvent(new o.RspFail({request:s,response:e}))})},_initC:function(e,t,n,s,a,c){var u=this;if(t&&t.rtcId!==e.getRtcId())throw i.error("stream and webrtc rtcId not equal."),"stream and webrtc rtcId not equal.";var d=u.newMessage().setOp(102).setRtcId(e.getRtcId()).setSdp(n).setSubSId(s);e.subArgs&&r.extend(d,e.subArgs),t&&t.located()&&d.setPubS(t),u.postMessage(d,function(n){if(0!=n.result)return u.onEvent(new o.RspFail({request:d,response:n})),void(a&&a(new o.RspFail({request:d,response:n,hidden:!0===n.retrying})));t&&!t.id&&n.streamId&&(t.id=n.streamId);try{c&&c()}catch(r){i.warn(r)}n.sdp&&u.ansC(e.getRtcId(),n.sdp,n.cands),n.mems&&u.onMembers&&u.onMembers(n.cver,n.mems),n.streams&&u.onStreams&&u.onStreams(n.cver,n.streams)})},_acptC:function(e,t,n){var r=this,i=r.newMessage().setOp(104).setRtcId(e.getRtcId()).setSdp(t);r.postMessage(i,function(e){if(0!=e.result)return r.onEvent(new o.RspFail({request:i,response:e})),void(n&&n(new o.RspFail({request:i,response:e})))})},_ansCAndPubstream:function(e,t,n,s,a){var c=this,u=c.newMessage().setOp(106).setRtcId(e.getRtcId()).setSdp(n);e.subArgs&&r.extend(u,e.subArgs),t&&t.located()&&(t=r.extend({},t),r.removeAttribute(t,"mutedMuted"),r.removeAttribute(t,"_located"),u.setPubS(t)),c.postMessage(u,function(e){if(0!=e.result)return c.onEvent(new o.RspFail({request:u,response:e})),void(s&&s(new o.RspFail({request:u,response:e,hidden:!0===e.retrying})));t&&!t.id&&e.streamId&&(t.id=e.streamId);try{a&&a()}catch(n){i.warn(n)}})},_ansC:function(e,t,n){var r=this,i=r.newMessage().setOp(106).setRtcId(e.getRtcId()).setSdp(t);r.postMessage(i,function(e){if(0!=e.result)return r.onEvent(new o.RspFail({request:i,response:e})),void(n&&n(new o.RspFail({request:i,response:e})))})},_termC:function(e,t,n){var r=this,i="string"==typeof e?e:e.getRtcId(),s=r.newMessage().setOp(107).setRtcId(i).setEndReason(t);r.postMessage(s,function(e){if(0!=e.result)return r.onEvent(new o.RspFail({request:s,response:e})),void(n&&n(new o.RspFail({request:s,response:e})))})},_iceCreateRtcPeerConnection:function(e){this._ices[e].createRtcPeerConnection(),i.debug("create rtc peer connection",e)},doOffer:function(e,t,n){this._ices[e].createOffer(function(e){t(e)})},offerCall:function(e,t,n,r,i){var o=this,s=o._ices[e];s.createOffer(function(e){o._initC&&o._initC(s,t,e,n,r,i)})},accept:function(e,t){var n=this,r=n._ices[e];r.createPRAnswer(function(e){n._acptC&&n._acptC(r,e,t)})},answerCall:function(e,t,n,r){var i=this,o=i._ices[e];o.createAnswer(function(e){i._ansCAndPubstream&&i._ansCAndPubstream(o,t,e,n,r)})},answer:function(e,t){var n=this,r=n._ices[e];r.createAnswer(function(e){n._ansC&&n._ansC(r,e,t)})},onTcklC:function(e,t){this._addIceCandidate(t,e)},onAcptC:function(e,t,n){this._iceSetRemoteSDP(t,e),n&&this._addIceCandidate(n,e)},onAnsC:function(e,t,n){this._iceSetRemoteSDP(t,e),n&&this._addIceCandidate(n,e)},_addIceCandidate:function(e,t){if(e&&0!=e.length){var n=this._ices[t];n&&n.addIceCandidate(e)}else i.warn("drop cands",e)},closeWebrtc:function(e,t,n){var o=this,s=o._ices[e];if(r.forEach(o._cacheStreams,function(t,n){if(n.rtcId===e&&!n.located())try{var s=r.removeAttribute(o._mediaMeters,t);s&&s._finally()}catch(a){i.warn(a)}n.rtcId===e&&2===n.type&&r.removeAttribute(o.audioMixers,n.id)}),!s||s.closed)return i.warn("Webrtc not exsits or closed",s&&s.closed),n&&s&&r.forEach(o._cacheStreams,function(t,n){n.rtcId===e&&(r.removeAttribute(o._linkedStreams,t),i.warn("Webrtc close, remvoe from _linkedStreams",t))}),void(n||o._termC(e,0));if(o._records){r.forEach(o._records,function(t,n){n.rtcId===e&&function(e){try{o.stopRecord(e)}catch(t){i.warn(t)}finally{r.removeAttribute(o._records,e.id)}}(n)})}try{n||s&&o._termC(s,t&&s._localStream?-10:0)}finally{s&&s.close(t),s&&o.onWebrtcTermC&&o.onWebrtcTermC(s),t||s&&r.forEach(o._cacheStreams,function(t,s){s.rtcId===e&&(s.located()&&(emedia.stopTracks(s._localMediaStream),o._cacheStreams[t]&&o._linkedStreams[t]&&o.onRemoveStream(s),r.removeAttribute(o._cacheStreams,t),o._monitSoundChanagedStreams&&r.removeAttribute(o._monitSoundChanagedStreams,t),i.info("Webrtc close. Remove stream",t,". from cache")),n&&(r.removeAttribute(o._linkedStreams,t),i.info("Webrtc close. Remove stream",t,". from _linkedStreams")))})}return s},__close:function(e){i.warn("closing, reason = ",e);if(!this.closed){if(this.closed=!0,this.__getCopyInterval&&(clearInterval(this.__getCopyInterval),i.warn("Stop interval get copy")),this._ices)for(var t in this._ices)this.closeWebrtc(t,!1);var n=this.newMessage().setOp(201).setReason(e||0);this.postMessage(n)}},exit:function(e){var t=this;e?(e&&t._closeMyConfr(11),setTimeout(function(){t.close(0)},100)):t.close(0)},_closeMyConfr:function(e){var t=this.newMessage().setOp(204).setReason(e||0);this.postMessage(t,function(e){i.warn("Close confr ",e.result,e.msg)})},close:function(e,t){var n=this;if(!n.closed)try{r.forEach(n._cacheStreams||{},function(e,t){t.located()&&t._localMediaStream&&emedia.stopTracks(t._localMediaStream)}),n.__close(e),r.forEach(n._cacheStreams,function(e,t){n.onRemoveStream(t)}),r.forEach(n._cacheMembers,function(e,t){n.onRemoveMember(t)})}finally{try{setTimeout(function(){n._session&&n._session.close(e)},500),n.onEvent(new o.Hangup({reason:e,failed:t,self:{id:n._memberId}})),n.onMeExit&&n.onMeExit(e,t)}catch(s){i.error(s)}finally{n._onFinally&&n._onFinally()}}},webrtcState:function(e){return this._ices[e].iceConnectionState()},_iceSetRemoteSDP:function(e,t){this._ices[t].setRemoteDescription(e)},setLocalStream:function(e,t){this._ices[t].setLocalStream(e)},onWebrtcTermC:function(e){}})},function(e,t,n){var r=n(15),i=r.tagLogger("Webrtc"),o=(n(21),n(25)),s={headerSection:null,audioSection:null,videoSection:null,_parseHeaderSection:function(e,t,n){var r=t;return-1===n||(r=-1===t?n:Math.min(t,n)),r>=0?e.slice(0,r):e},_parseAudioSection:function(e,t,n){var r=t;if(r>=0)return e.slice(r,n<r?e.length:n)},_parseVideoSection:function(e,t,n){var r=n;if(r>=0)return e.slice(r,t<r?e.length:t)},spiltSection:function(e){this._preSDP=e;var t=this._preAudioIndex=e.indexOf("m=audio"),n=this._preVideoIndex=e.indexOf("m=video");this.headerSection=this._parseHeaderSection(e,t,n),this.audioSection=this._parseAudioSection(e,t,n),this.videoSection=this._parseVideoSection(e,t,n)},setVideoBitrate:function(e){e&&this.videoSection&&(this.videoSection=this.setBitrate(this.videoSection,e))},setAudioBitrate:function(e){e&&this.audioSection&&(this.audioSection=this.setBitrate(this.audioSection,e))},setBitrate:function(e,t){return(e=e.replace(/(b=)(?:AS|TIAS)(\:)\d+/g,"$1AS$2"+t)).indexOf("b=AS")<0&&(e=e.replace(/(m=(?:audio|video)[^\r\n]+)([\r\n]+)/g,"$1$2b=AS:"+t+"$2")),e},updateVideoSection:function(e,t){this.videoSection&&(this.videoSection=this.videoSection.replace(e,t))},updateAudioSection:function(e,t){this.audioSection&&(this.audioSection=this.audioSection.replace(e,t))},updateVideoSendonly:function(){this.videoSection&&(this.videoSection=this.videoSection.replace(/sendrecv/g,"sendonly"))},updateVideoRecvonly:function(){this.videoSection&&(this.videoSection=this.videoSection.replace(/sendrecv/g,"recvonly"))},updateAudioSendonly:function(){this.audioSection&&(this.audioSection=this.audioSection.replace(/sendrecv/g,"sendonly"))},updateAudioRecvonly:function(){this.audioSection&&(this.audioSection=this.audioSection.replace(/sendrecv/g,"recvonly"))},updateVCodes:function(e){if(e&&this.videoSection){if("string"==typeof e)(n=[]).push(e),e=n;for(var t={},n=this._parseLine(this.videoSection,/a=rtpmap:(\d+) ([A-Za-z0-9]+)\/.*/gi),o=0;o<n.length;o++){var s=n[++o];t[n[++o]]=s}var a=this._parseLine(this.videoSection,/a=fmtp:(\d+) .*profile-level-id=42e01f;?.*/gi);a&&a.length>=2&&(t.H264=a[1]);var c=[];for(o=0;o<e.length;o++){var u=t[e[o]];u&&c.push(u)}0==c.length&&(i.warn("Not found vcodes map",e),this._webrtc&&i.warn("Not found vcodes map",e,this._webrtc._rtcId,this._webrtc.__id));var d=this.videoSection.indexOf("\r"),l=this.videoSection.substring(0,d),f=l.split(" ");Array.prototype.push.apply(c,f.slice(3));var p=[],h={};r.forEach(c,function(e,t){0==p.length?(p.push(t),h[t]=!0):h[t]||(p.push(t),h[t]=!0)}),f.splice(3,f.length-3,p.join(" ")),l=f.join(" "),this._webrtc&&i.warn(l,this._webrtc._rtcId,this._webrtc.__id),this.videoSection=l+this.videoSection.substring(d)}},removeSSRC:function(e){for(var t=[],n=e.split(/a=ssrc:[^\n]+/g),r=0;r<n.length;r++)"\n"!=n[r]&&t.push(n[r]);return t.join("\n")},removeField_msid:function(e){for(var t=[],n=e.split(/a=msid:[^\n]+/g),r=0;r<n.length;r++)"\n"!=n[r]&&t.push(n[r]);e=t.join("\n"),t=[],n=e.split(/[\n]+/g);for(r=0;r<n.length;r++)"\n"!=n[r]&&t.push(n[r]);return t.join("\n")},updateHeaderMsidSemantic:function(e){var t="a=msid-semantic: WMS "+e,n=this.headerSection.split(/a=msid\-semantic: WMS.*/g),r=[];switch(n.length){case 1:r.push(n[0]);break;case 2:r.push(n[0]),r.push(t),r.push("\n");break;case 3:r.push(n[0]),r.push(t),r.push("\n"),r.push(n[2]),r.push("\n")}return this.headerSection=r.join("")},updateAudioSSRCSection:function(e,t,n,r){this.audioSection&&(this.audioSection=this.removeSSRC(this.audioSection)),this.audioSection&&(this.audioSection=this.removeField_msid(this.audioSection)),this.audioSection&&(this.audioSection=this.audioSection+this.ssrcSection(e,t,n,r))},updateVideoSSRCSection:function(e,t,n,r){this.videoSection&&(this.videoSection=this.removeSSRC(this.videoSection)),this.videoSection&&(this.videoSection=this.removeField_msid(this.videoSection)),this.videoSection&&(this.videoSection=this.videoSection+this.ssrcSection(e,t,n,r))},getUpdatedSDP:function(e){var t="";if(this.headerSection&&(t+=this.headerSection),!0===e||void 0===e&&this._preAudioIndex<this._preVideoIndex)this.audioSection&&(t+=this.audioSection),this.videoSection&&(t+=this.videoSection);else{var n,r;if(!1===e&&this.videoSection&&this.audioSection)this.videoSection.replace(/a=mid:([^\r\n]+)/,function(e,t){return n=t,e}),this.audioSection.replace(/a=mid:([^\r\n]+)/,function(e,t){return r=t,e}),t=this.headerSection.replace(/a=group:BUNDLE [^\r\n]+/,"a=group:BUNDLE "+n+" "+r);this.videoSection&&(t+=this.videoSection),this.audioSection&&(t+=this.audioSection)}return t},parseMsidSemantic:function(e){var t=this._parseLine(e,/a=msid\-semantic:\s*WMS (\S+)/gi);return t&&2==t.length&&(this.msidSemantic={line:t[0],WMS:t[1]}),this.msidSemantic},ssrcSection:function(e,t,n,r){return["a=ssrc:"+e+" cname:"+t,"a=ssrc:"+e+" msid:"+n+" "+r,"a=ssrc:"+e+" mslabel:"+n,"a=ssrc:"+e+" label:"+r,""].join("\n")},parseSSRC:function(e){var t=new RegExp("a=(ssrc):(\\d+) (\\S+):(\\S+)","ig"),n=this._parseLine(e,t);if(n){for(var r={lines:[],updateSSRCSection:this.ssrcSection},i=0;i<n.length;i++){var o=n[i];if(o.indexOf("a=ssrc")>=0)r.lines.push(o);else switch(o){case"ssrc":case"cname":case"msid":case"mslabel":case"label":r[o]=n[++i]}}return r}},_parseLine:function(e,t){for(var n,r=[];null!=(n=t.exec(e));)for(var i=0;i<n.length;i++)r.push(n[i]);if(r.length>0)return r}},a=function(e,t){r.extend(this,s),this._webrtc=t,this.spiltSection(e)};a.isAudioVideo=function(e){return e.indexOf("m=audio")<e.indexOf("m=video")},a.isVideoPreAudio=function(e){var t=e.indexOf("m=audio"),n=e.indexOf("m=video");return t>=0&&n>=0&&n<t};var c=emedia.__rtc_globalCount=0,u=r.prototypeExtend({closed:!1,sdpConstraints:{mandatory:{OfferToReceiveAudio:!0,OfferToReceiveVideo:!0}},offerOptions:{offerToReceiveAudio:!0,offerToReceiveVideo:!0},optimalVideoCodecs:null,optimalAudioCodecs:null,__init__:function(){this._rtcId||(this._rtcId="RTC"+c++),this.__id="_i_"+c++,this.__setRemoteSDP=!1,this.__tmpRemoteCands=[],this.__tmpLocalCands=[],this._rtcPeerConnection=null,this.cctx=this.__id,i.info("Webrtc created.",this._rtcId,this.__id)},getRtcId:function(){return this._rtcId},iceState:function(){return this._rtcPeerConnection.iceConnectionState},setSubArgs:function(e){this.subArgs=e},getReceiversOfPeerConnection:function(){if(this._rtcPeerConnection&&"closed"!=this._rtcPeerConnection.iceConnectionState)return this._rtcPeerConnection.getReceivers()},updateRemoteBySubArgs:function(){this.subArgs&&this._remoteStream&&(emedia.enableVideoTracks(this._remoteStream,!(this.subArgs&&!1===this.subArgs.subSVideo)),emedia.enableAudioTracks(this._remoteStream,!(this.subArgs&&!1===this.subArgs.subSAudio)),i.info("enable tracks remote stream",this._remoteStream,this.subArgs,this._rtcId,this.__id,this.closed))},createRtcPeerConnection:function(e){var t=this;i.debug("begin create peer connection ......",t._rtcId,t.__id,t.closed),e||(e=t.iceServerConfig),e||emedia.isEdge?(e||(e={}),!e.iceServers&&(e.iceServers=[]),e.rtcpMuxPolicy="require",e.bundlePolicy="max-bundle",e.relayOnly&&(e.iceTransportPolicy="relay")):e=null,i.info("create pc, set config:",e,t._rtcId,t.__id,t.closed);var n=t._rtcPeerConnection=new RTCPeerConnection(e);function r(e){i.info("states: conn",n.connectionState||n.iceConnectionState,", ice",n.iceConnectionState,"@",t._rtcId,t.__id,t.closed);try{t.onIceStateChange(n.iceConnectionState)}finally{}}n.__peerId=t._rtcId,i.debug("created local peer connection object",n,t._rtcId),n.onicecandidate=function(e){var n=e.candidate;if("icecandidate"!=e.type||n&&("string"!=typeof n.protocol||"tcp"!==n.protocol.toLowerCase())&&!/ TCP /.test(n.candidate)){if(!n.candidate)throw i.error("Not found candidate. candidate is error"),"Not found candidate. candidate is error,";if(n.cctx=t.cctx,!t.__setRemoteSDP)return(t.__tmpLocalCands||(t.__tmpLocalCands={})).push(n),void i.debug("On ICE candidate ok: but tmp buffer caused by not set remote sdp: ",n,t._rtcId,t.__id,t.closed);i.debug("On ICE candidate ok: ",n,t._rtcId,t.__id,t.closed),t._onIceCandidate(n)}else i.debug("On ICE candidate: drop",n,t._rtcId,t.__id,t.closed)},n.onconnectionstatechange=r.bind(t),n.onicestatechange=r.bind(t),n.oniceconnectionstatechange=r.bind(t),n.onsignalingstatechange=function(e){i.info("states: signaling",n.signalingState,"@",t._rtcId,t.__id,t.closed)},null===n.ontrack&&t._onTrack&&(n.ontrack=function(e){t._onTrack(e)}),n.onaddstream=function(e){t._onGotRemoteStream(e)}},addTrack:function(e,t){var n=this;e.forEach(function(e){n._rtcPeerConnection.addTrack(e,t)})},setLocalStream:function(e){var t=this;t._localStream=e,t._rtcPeerConnection.addTrack?e.getTracks().forEach(function(n){t._rtcPeerConnection.addTrack(n,e)}):t._rtcPeerConnection.addStream(e),i.debug("Added local stream to RtcPeerConnection",e,t._rtcId,t.__id,this.closed)},removeStream:function(e){this._rtcPeerConnection.removeStream(e),i.debug("Remove stream from RtcPeerConnection",e,self._rtcId,self.__id,this.closed)},getLocalStream:function(){return this._localStream},getRemoteStream:function(){return this._remoteStream},createOffer:function(e,t){var n=this;i.debug("createOffer start...",n.offerOptions);var o=r.extend({},n.offerOptions);return n.subArgs&&(o={offerToReceiveAudio:!0,offerToReceiveVideo:!0}),n._rtcPeerConnection.createOffer(o).then(function(t){var r;if(n.offerDescription=t,emedia.isEdge&&(t.sdp=t.sdp.replace(/profile-level-id=[^;]+/,"profile-level-id=42e01f")),emedia.isFirefox?n.fireFoxOfferVideoPreAudio=n.__offerVideoPreAudio=a.isVideoPreAudio(t.sdp):n.__offerVideoPreAudio=a.isVideoPreAudio(t.sdp),t.sdp=t.sdp.replace(/m=video 0/g,"m=video 9"),i.warn("setLocalDescription. modify offer. if 'm=video 0' -> 'm=video 9'; if H264, 'profile-level-id=42e01f'",n._rtcId,n.__id),(r=n.optimalVideoCodecs&&("string"==typeof n.optimalVideoCodecs||n.optimalVideoCodecs.length>0))||n.offerOptions&&(!1===n.offerOptions.offerToReceiveVideo||!1===n.offerOptions.offerToReceiveAudio)){var o=new a(t.sdp,n);r&&o.updateVCodes(n.optimalVideoCodecs),n.offerOptions&&!1===n.offerOptions.offerToReceiveVideo&&o.updateVideoSection(/a=sendrecv|a=recvonly/g,"a=sendonly"),n.offerOptions&&!1===n.offerOptions.offerToReceiveAudio&&o.updateAudioSection(/a=sendrecv|a=recvonly/g,"a=sendonly"),t.sdp=o.getUpdatedSDP()}i.debug("setLocalDescription start",t,n._rtcId,n.__id,n.closed,n.optimalVideoCodecs),n._rtcPeerConnection.setLocalDescription(t).then(n._onSetLocalSessionDescriptionSuccess.bind(n),n._onSetSessionDescriptionError.bind(n)).then(function(){t.cctx=n.cctx,(e||n.onCreateOfferSuccess.bind(n))(t)})},t||n._onCreateSessionDescriptionError.bind(n))},createPRAnswer:function(e,t){var n=this;return i.info(" createPRAnswer start",n.closed,n.sdpConstraints),n._rtcPeerConnection.createAnswer(n.sdpConstraints).then(function(t){i.debug("_____________PRAnswer ",t.sdp,n._rtcId,n.__id,n.closed),t.type="pranswer",t.sdp=t.sdp.replace(/a=recvonly/g,"a=inactive"),n.__prAnswerDescription=t,i.debug("inactive PRAnswer ",t.sdp,n._rtcId,n.__id,n.closed),i.debug("setLocalDescription start",t,n._rtcId,n.__id,n.closed),n._rtcPeerConnection.setLocalDescription(t).then(n._onSetLocalSessionDescriptionSuccess.bind(n),n._onSetSessionDescriptionError.bind(n)).then(function(){var r=new a(t.sdp);r.updateHeaderMsidSemantic("MS_0000"),r.updateAudioSSRCSection(1e3,"CHROME0000","MS_0000","LABEL_AUDIO_1000"),r.updateVideoSSRCSection(2e3,"CHROME0000","MS_0000","LABEL_VIDEO_2000"),t.sdp=r.getUpdatedSDP(),i.debug("Send PRAnswer ",t.sdp,n._rtcId,n.__id,n.closed),n.cctx&&(t.cctx=n.cctx),(e||n.onCreatePRAnswerSuccess.bind(n))(t)})},t||n._onCreateSessionDescriptionError.bind(n))},createAnswer:function(e,t){var n=this;return i.info("createAnswer start",n.closed,n.sdpConstraints),n._rtcPeerConnection.createAnswer(n.sdpConstraints).then(function(t){i.debug("_____________________Answer ",n._rtcId,n.__id,n.closed),t.type="answer",emedia.supportPRAnswer&&function(){var e=new a(t.sdp),n=e.parseMsidSemantic(e.headerSection);if(n){"*"==n.WMS&&e.updateHeaderMsidSemantic(n.WMS="MS_0000");var r=e.parseSSRC(e.audioSection),i=e.parseSSRC(e.videoSection);r&&e.updateAudioSSRCSection(1e3,"CHROME0000",n.WMS,r.label||"LABEL_AUDIO_1000"),i&&e.updateVideoSSRCSection(2e3,"CHROME0000",n.WMS,i.label||"LABEL_VIDEO_2000"),t.sdp=e.getUpdatedSDP()}}(),n.__answerDescription=t,i.debug("Answer ",n._rtcId,n.__id,n.closed),i.debug("setLocalDescription start",t,n._rtcId,n.__id,n.closed),n._rtcPeerConnection.setLocalDescription(t).then(n._onSetLocalSessionDescriptionSuccess.bind(n),n._onSetSessionDescriptionError.bind(n)).then(function(){if(emedia.supportPRAnswer){var r=new a(t.sdp);r.updateHeaderMsidSemantic("MS_0000"),r.updateAudioSSRCSection(1e3,"CHROME0000","MS_0000","LABEL_AUDIO_1000"),r.updateVideoSSRCSection(2e3,"CHROME0000","MS_0000","LABEL_VIDEO_2000"),t.sdp=r.getUpdatedSDP()}i.debug("Send Answer ",n._rtcId,n.__id,n.closed),n.cctx&&(t.cctx=n.cctx),(e||n.onCreateAnswerSuccess.bind(n))(t)})},t||n._onCreateSessionDescriptionError.bind(n))},close:function(e,t){if(i.warn("webrtc closing",this._rtcId,this.__id,this.closed),!this.closed){t=!0===t,this.closed=!0;try{this._rtcPeerConnection&&this._rtcPeerConnection.close()}catch(n){i.warn(n)}finally{this._localStream&&!1===e&&emedia.stopTracks(this._localStream),this._remoteStream&&emedia.stopTracks(this._remoteStream),this._remoteStream=null,t||this.onClose&&this.onClose(),i.warn("webrtc closed. closed:",this._rtcId,this.__id,this.closed)}}},addIceCandidate:function(e){if(this._rtcPeerConnection){i.debug("Add ICE candidate: ",e,this._rtcId,this.__id,this.closed);var t=r.isArray(e)?e:[];if(!r.isArray(e)&&t.push(e),!this.__setRemoteSDP)return Array.prototype.push.apply(this.__tmpRemoteCands||(this.__tmpRemoteCands={}),t),void i.debug("Add ICE candidate but tmp buffer caused by not set remote sdp: ",e,this._rtcId,this.__id,this.closed);for(var n=0;n<t.length;n++)if((e=t[n]).cctx&&e.cctx!=this.cctx)i.warn("addIceCandidate fail drop. cctx not equal. ",e,this._rtcId,this.__id,this.closed);else{if(!0===this.fireFoxOfferVideoPreAudio){var o=e.sdpMLineIndex;e.sdpMLineIndex=parseInt(e.sdpMid.replace(/[^0-9]*/,"")),i.warn("Firefox sdp section video pre audio, sdp mline index update ",o,"->",e.sdpMLineIndex)}e.candidate&&""!==e.candidate?this._rtcPeerConnection.addIceCandidate(new RTCIceCandidate(e)).then(this.onAddIceCandidateSuccess.bind(this),this._onAddIceCandidateError.bind(this)):i.warn("Add ICE candidate fail. drop it ",e,this._rtcId,this.__id,this.closed)}}},setRemoteDescription:function(e){var t=this;if(i.debug("setRemoteDescription start. ",t._rtcId,t.__id,t.closed),t.offerDescription){if(e.cctx&&e.cctx!=t.cctx)return void i.warn("setRemoteDescription fail drop. cctx not equal. ",e,t._rtcId,t.__id,t.closed);if(!0===t.fireFoxOfferVideoPreAudio||!0===t.__offerVideoPreAudio){var n=new a(e.sdp,t);e.sdp=n.getUpdatedSDP(!1),i.info("Remote sdp.2. switch audio video",e.sdp)}}else e.cctx&&(t.cctx=e.cctx);if(e.sdp=e.sdp.replace(/UDP\/TLS\/RTP\/SAVPF/g,"RTP/SAVPF"),i.warn("setRemoteDescription. UDP/TLS/RTP/SAVPF -> RTP/SAVPF; if firefox: switch audio video;",t._rtcId,t.__id),i.debug("setRemoteDescription.",e,t._rtcId,t.__id),t.vbitrate||t.abitrate){n=new a(e.sdp,t);t.vbitrate&&n.setVideoBitrate(t.vbitrate),t.abitrate&&n.setAudioBitrate(t.abitrate),i.warn("vbitrate = ",t.vbitrate,", abitrate = ",t.abitrate,t._rtcId,t.__id),e.sdp=n.getUpdatedSDP()}return e=t.__remoteDescription=new RTCSessionDescription(e),t._rtcPeerConnection.setRemoteDescription(e).then(function(){t.__setRemoteSDP=!0,t._onSetRemoteSuccess.apply(t,arguments),t.__tmpLocalCands&&t.__tmpLocalCands.length>0&&(i.debug("After setRemoteDescription. send cands",t._rtcId,t.__id,t.closed),t._onIceCandidate(t.__tmpLocalCands),t.__tmpLocalCands=[]),t.__tmpRemoteCands&&t.__tmpRemoteCands.length>0&&(i.debug("After setRemoteDescription. add tmp cands",t._rtcId,t.__id,t.closed),t.addIceCandidate(t.__tmpRemoteCands),t.__tmpRemoteCands=[])},t._onSetSessionDescriptionError.bind(t))},iceConnectionState:function(){return this._rtcPeerConnection.iceConnectionState},isConnected:function(){var e=this._rtcPeerConnection.iceConnectionState;return"connected"===e||"completed"===e},_onGotRemoteStream:function(e){i.debug("onGotRemoteStream.",this._rtcId,this.__id,e),this._remoteStream=e.stream||e.streams[0],this._remoteStream._rtcId=this._rtcId,this._remoteStream.__rtc_c_id=this.__id,this.updateRemoteBySubArgs(),this.onGotRemoteStream(this._remoteStream,e),i.debug("received remote stream, you will see the other.",this._rtcId,this.__id,this.closed)},_onSetRemoteSuccess:function(){i.info("onSetRemoteSuccess success",this._rtcId,this.__id),this.onSetRemoteSuccess.apply(this,arguments),this.offerDescription&&this.__remoteDescription&&this.__remoteDescription.sdp&&this._onAnswerCodes(this.__remoteDescription.sdp)},_onAnswerCodes:function(e){var t=new a(e,this);if(t.videoSection){var n=o.parseRtpParameters(t.videoSection);if(!n.codecs||0===n.codecs.length)return void i.info("not found any video codes. @ ",this._rtcId,this.__id);var s=[];r.forEach(n.codecs,function(e,t){s.push(t.name)}),this.finalVCodeChoices=s,this.onVCodeChoices&&this.onVCodeChoices(s)}},onSetRemoteSuccess:function(){},onAddIceCandidateSuccess:function(){i.debug("addIceCandidate success",this._rtcId,this.__id)},_onAddIceCandidateError:function(e){i.error("failed to add ICE Candidate: "+e.toString(),this._rtcId,this.__id),this.onAddIceCandidateError(e)},onAddIceCandidateError:function(e){},_onIceCandidate:function(e){i.debug("onIceCandidate:",e,this._rtcId,this.__id),this.onIceCandidate(e)},onIceCandidate:function(e){},onIceStateChange:function(e){i.debug("onIceStateChange : ICE state ",e)},_onCreateSessionDescriptionError:function(e){i.error("Failed to create session description: "+e.toString(),this._rtcId,this.__id),this.onCreateSessionDescriptionError(e)},onCreateSessionDescriptionError:function(e){},onCreateOfferSuccess:function(e){i.debug("create offer success",this._rtcId,this.__id)},onCreatePRAnswerSuccess:function(e){i.debug("create answer success",this._rtcId,this.__id)},onCreateAnswerSuccess:function(e){i.debug("create answer success",this._rtcId,this.__id)},_onSetSessionDescriptionError:function(e){i.error("onSetSessionDescriptionError : Failed to set session description: "+e.toString(),this._rtcId,this.__id),this.onSetSessionDescriptionError(e)},onSetSessionDescriptionError:function(e){},_onSetLocalSessionDescriptionSuccess:function(){i.debug("onSetLocalSessionDescriptionSuccess : setLocalDescription complete",this._rtcId,this.__id),this.onSetLocalSessionDescriptionSuccess(),this.__answerDescription&&this.__answerDescription.sdp&&this._onAnswerCodes(this.__answerDescription.sdp)},onSetLocalSessionDescriptionSuccess:function(){},onGotRemoteStream:function(e){i.debug("Got remote stream. ",e,this._rtcId,this.__id)}});e.exports=u},function(e,t,n){"use strict";var r={generateIdentifier:function(){return Math.random().toString(36).substr(2,10)}};r.localCName=r.generateIdentifier(),r.splitLines=function(e){return e.trim().split("\n").map(function(e){return e.trim()})},r.splitSections=function(e){return e.split("\nm=").map(function(e,t){return(t>0?"m="+e:e).trim()+"\r\n"})},r.getDescription=function(e){var t=r.splitSections(e);return t&&t[0]},r.getMediaSections=function(e){var t=r.splitSections(e);return t.shift(),t},r.matchPrefix=function(e,t){return r.splitLines(e).filter(function(e){return 0===e.indexOf(t)})},r.parseCandidate=function(e){for(var t,n={foundation:(t=0===e.indexOf("a=candidate:")?e.substring(12).split(" "):e.substring(10).split(" "))[0],component:parseInt(t[1],10),protocol:t[2].toLowerCase(),priority:parseInt(t[3],10),ip:t[4],port:parseInt(t[5],10),type:t[7]},r=8;r<t.length;r+=2)switch(t[r]){case"raddr":n.relatedAddress=t[r+1];break;case"rport":n.relatedPort=parseInt(t[r+1],10);break;case"tcptype":n.tcpType=t[r+1];break;case"ufrag":n.ufrag=t[r+1],n.usernameFragment=t[r+1];break;default:n[t[r]]=t[r+1]}return n},r.writeCandidate=function(e){var t=[];t.push(e.foundation),t.push(e.component),t.push(e.protocol.toUpperCase()),t.push(e.priority),t.push(e.ip),t.push(e.port);var n=e.type;return t.push("typ"),t.push(n),"host"!==n&&e.relatedAddress&&e.relatedPort&&(t.push("raddr"),t.push(e.relatedAddress),t.push("rport"),t.push(e.relatedPort)),e.tcpType&&"tcp"===e.protocol.toLowerCase()&&(t.push("tcptype"),t.push(e.tcpType)),(e.usernameFragment||e.ufrag)&&(t.push("ufrag"),t.push(e.usernameFragment||e.ufrag)),"candidate:"+t.join(" ")},r.parseIceOptions=function(e){return e.substr(14).split(" ")},r.parseRtpMap=function(e){var t=e.substr(9).split(" "),n={payloadType:parseInt(t.shift(),10)};return t=t[0].split("/"),n.name=t[0],n.clockRate=parseInt(t[1],10),n.channels=3===t.length?parseInt(t[2],10):1,n.numChannels=n.channels,n},r.writeRtpMap=function(e){var t=e.payloadType;void 0!==e.preferredPayloadType&&(t=e.preferredPayloadType);var n=e.channels||e.numChannels||1;return"a=rtpmap:"+t+" "+e.name+"/"+e.clockRate+(1!==n?"/"+n:"")+"\r\n"},r.parseExtmap=function(e){var t=e.substr(9).split(" ");return{id:parseInt(t[0],10),direction:t[0].indexOf("/")>0?t[0].split("/")[1]:"sendrecv",uri:t[1]}},r.writeExtmap=function(e){return"a=extmap:"+(e.id||e.preferredId)+(e.direction&&"sendrecv"!==e.direction?"/"+e.direction:"")+" "+e.uri+"\r\n"},r.parseFmtp=function(e){for(var t,n={},r=e.substr(e.indexOf(" ")+1).split(";"),i=0;i<r.length;i++)n[(t=r[i].trim().split("="))[0].trim()]=t[1];return n},r.writeFmtp=function(e){var t="",n=e.payloadType;if(void 0!==e.preferredPayloadType&&(n=e.preferredPayloadType),e.parameters&&Object.keys(e.parameters).length){var r=[];Object.keys(e.parameters).forEach(function(t){e.parameters[t]?r.push(t+"="+e.parameters[t]):r.push(t)}),t+="a=fmtp:"+n+" "+r.join(";")+"\r\n"}return t},r.parseRtcpFb=function(e){var t=e.substr(e.indexOf(" ")+1).split(" ");return{type:t.shift(),parameter:t.join(" ")}},r.writeRtcpFb=function(e){var t="",n=e.payloadType;return void 0!==e.preferredPayloadType&&(n=e.preferredPayloadType),e.rtcpFeedback&&e.rtcpFeedback.length&&e.rtcpFeedback.forEach(function(e){t+="a=rtcp-fb:"+n+" "+e.type+(e.parameter&&e.parameter.length?" "+e.parameter:"")+"\r\n"}),t},r.parseSsrcMedia=function(e){var t=e.indexOf(" "),n={ssrc:parseInt(e.substr(7,t-7),10)},r=e.indexOf(":",t);return r>-1?(n.attribute=e.substr(t+1,r-t-1),n.value=e.substr(r+1)):n.attribute=e.substr(t+1),n},r.getMid=function(e){var t=r.matchPrefix(e,"a=mid:")[0];if(t)return t.substr(6)},r.parseFingerprint=function(e){var t=e.substr(14).split(" ");return{algorithm:t[0].toLowerCase(),value:t[1]}},r.getDtlsParameters=function(e,t){return{role:"auto",fingerprints:r.matchPrefix(e+t,"a=fingerprint:").map(r.parseFingerprint)}},r.writeDtlsParameters=function(e,t){var n="a=setup:"+t+"\r\n";return e.fingerprints.forEach(function(e){n+="a=fingerprint:"+e.algorithm+" "+e.value+"\r\n"}),n},r.getIceParameters=function(e,t){var n=r.splitLines(e);return{usernameFragment:(n=n.concat(r.splitLines(t))).filter(function(e){return 0===e.indexOf("a=ice-ufrag:")})[0].substr(12),password:n.filter(function(e){return 0===e.indexOf("a=ice-pwd:")})[0].substr(10)}},r.writeIceParameters=function(e){return"a=ice-ufrag:"+e.usernameFragment+"\r\na=ice-pwd:"+e.password+"\r\n"},r.parseRtpParameters=function(e){for(var t={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},n=r.splitLines(e)[0].split(" "),i=3;i<n.length;i++){var o=n[i],s=r.matchPrefix(e,"a=rtpmap:"+o+" ")[0];if(s){var a=r.parseRtpMap(s),c=r.matchPrefix(e,"a=fmtp:"+o+" ");switch(a.parameters=c.length?r.parseFmtp(c[0]):{},a.rtcpFeedback=r.matchPrefix(e,"a=rtcp-fb:"+o+" ").map(r.parseRtcpFb),t.codecs.push(a),a.name.toUpperCase()){case"RED":case"ULPFEC":t.fecMechanisms.push(a.name.toUpperCase())}}}return r.matchPrefix(e,"a=extmap:").forEach(function(e){t.headerExtensions.push(r.parseExtmap(e))}),t},r.writeRtpDescription=function(e,t){var n="";n+="m="+e+" ",n+=t.codecs.length>0?"9":"0",n+=" UDP/TLS/RTP/SAVPF ",n+=t.codecs.map(function(e){return void 0!==e.preferredPayloadType?e.preferredPayloadType:e.payloadType}).join(" ")+"\r\n",n+="c=IN IP4 0.0.0.0\r\n",n+="a=rtcp:9 IN IP4 0.0.0.0\r\n",t.codecs.forEach(function(e){n+=r.writeRtpMap(e),n+=r.writeFmtp(e),n+=r.writeRtcpFb(e)});var i=0;return t.codecs.forEach(function(e){e.maxptime>i&&(i=e.maxptime)}),i>0&&(n+="a=maxptime:"+i+"\r\n"),n+="a=rtcp-mux\r\n",t.headerExtensions&&t.headerExtensions.forEach(function(e){n+=r.writeExtmap(e)}),n},r.parseRtpEncodingParameters=function(e){var t,n=[],i=r.parseRtpParameters(e),o=-1!==i.fecMechanisms.indexOf("RED"),s=-1!==i.fecMechanisms.indexOf("ULPFEC"),a=r.matchPrefix(e,"a=ssrc:").map(function(e){return r.parseSsrcMedia(e)}).filter(function(e){return"cname"===e.attribute}),c=a.length>0&&a[0].ssrc,u=r.matchPrefix(e,"a=ssrc-group:FID").map(function(e){return e.substr(17).split(" ").map(function(e){return parseInt(e,10)})});u.length>0&&u[0].length>1&&u[0][0]===c&&(t=u[0][1]),i.codecs.forEach(function(e){if("RTX"===e.name.toUpperCase()&&e.parameters.apt){var r={ssrc:c,codecPayloadType:parseInt(e.parameters.apt,10)};c&&t&&(r.rtx={ssrc:t}),n.push(r),o&&((r=JSON.parse(JSON.stringify(r))).fec={ssrc:t,mechanism:s?"red+ulpfec":"red"},n.push(r))}}),0===n.length&&c&&n.push({ssrc:c});var d=r.matchPrefix(e,"b=");return d.length&&(d=0===d[0].indexOf("b=TIAS:")?parseInt(d[0].substr(7),10):0===d[0].indexOf("b=AS:")?1e3*parseInt(d[0].substr(5),10)*.95-16e3:void 0,n.forEach(function(e){e.maxBitrate=d})),n},r.parseRtcpParameters=function(e){var t={},n=r.matchPrefix(e,"a=ssrc:").map(function(e){return r.parseSsrcMedia(e)}).filter(function(e){return"cname"===e.attribute})[0];n&&(t.cname=n.value,t.ssrc=n.ssrc);var i=r.matchPrefix(e,"a=rtcp-rsize");t.reducedSize=i.length>0,t.compound=0===i.length;var o=r.matchPrefix(e,"a=rtcp-mux");return t.mux=o.length>0,t},r.parseMsid=function(e){var t,n=r.matchPrefix(e,"a=msid:");if(1===n.length)return{stream:(t=n[0].substr(7).split(" "))[0],track:t[1]};var i=r.matchPrefix(e,"a=ssrc:").map(function(e){return r.parseSsrcMedia(e)}).filter(function(e){return"msid"===e.attribute});return i.length>0?{stream:(t=i[0].value.split(" "))[0],track:t[1]}:void 0},r.generateSessionId=function(){return Math.random().toString().substr(2,21)},r.writeSessionBoilerplate=function(e,t){var n=void 0!==t?t:2;return"v=0\r\no=thisisadapterortc "+(e||r.generateSessionId())+" "+n+" IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"},r.writeMediaSection=function(e,t,n,i){var o=r.writeRtpDescription(e.kind,t);if(o+=r.writeIceParameters(e.iceGatherer.getLocalParameters()),o+=r.writeDtlsParameters(e.dtlsTransport.getLocalParameters(),"offer"===n?"actpass":"active"),o+="a=mid:"+e.mid+"\r\n",e.direction?o+="a="+e.direction+"\r\n":e.rtpSender&&e.rtpReceiver?o+="a=sendrecv\r\n":e.rtpSender?o+="a=sendonly\r\n":e.rtpReceiver?o+="a=recvonly\r\n":o+="a=inactive\r\n",e.rtpSender){var s="msid:"+i.id+" "+e.rtpSender.track.id+"\r\n";o+="a="+s,o+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" "+s,e.sendEncodingParameters[0].rtx&&(o+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" "+s,o+="a=ssrc-group:FID "+e.sendEncodingParameters[0].ssrc+" "+e.sendEncodingParameters[0].rtx.ssrc+"\r\n")}return o+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" cname:"+r.localCName+"\r\n",e.rtpSender&&e.sendEncodingParameters[0].rtx&&(o+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" cname:"+r.localCName+"\r\n"),o},r.getDirection=function(e,t){for(var n=r.splitLines(e),i=0;i<n.length;i++)switch(n[i]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return n[i].substr(2)}return t?r.getDirection(t):"sendrecv"},r.getKind=function(e){return r.splitLines(e)[0].split(" ")[0].substr(2)},r.isRejected=function(e){return"0"===e.split(" ",2)[1]},r.parseMLine=function(e){var t=r.splitLines(e)[0].substr(2).split(" ");return{kind:t[0],port:parseInt(t[1],10),protocol:t[2],fmt:t.slice(3).join(" ")}},r.parseOLine=function(e){var t=r.matchPrefix(e,"o=")[0].substr(2).split(" ");return{username:t[0],sessionId:t[1],sessionVersion:parseInt(t[2],10),netType:t[3],addressType:t[4],address:t[5]}},e.exports=r},function(e,t,n){var r=n(15),i=n(27);emedia.subscribed=function(e){return!!e._located||(2===e.type?!(e._located||!e._webrtc):void 0!==e._webrtc)};var o=r.prototypeExtend({voff:0,aoff:0,__init__:function(){var e=this;if(!e._mediaStream)throw _logger.error("_mediaStream empty"),"_mediaStream empty";if(e.hasEnabledTracks(e._mediaStream)){if(!e.__audioContext)throw _logger.error("require audioContext"),"require audioContext";e.__soundMeter=new i(e.__audioContext),e.__soundMeter.connectToSource(e._mediaStream,function(t){if(t)throw t;e.__worked=e.__soundMeter.__worked=!0})}},hasEnabledTracks:function(e){return emedia.hasEnabledTracks(e)},getSoundMeters:function(){if(this.__soundMeter&&this.__worked)if(this._mediaStream.active){if(this.hasEnabledTracks(this._mediaStream))return{instant:this.__soundMeter.instant,slow:this.__soundMeter.slow,clip:this.__soundMeter.clip}}else this.__worked&&this._finally()},_finally:function(){this.__soundMeter&&(this.__soundMeter.stop(),this.__worked=this.__soundMeter.__worked=!1)}});e.exports=r.prototypeExtend({__undefinedEQDelete:!0,Update:r.prototypeExtend({ifAoff:function(e){this.if("aoff",e)},ifVoff:function(e){this.if("voff",e)},ifMediaStream:function(e){this.if("mediaStream",e)},if:function(e,t){void 0!==this[e]&&t(this[e])}}),located:function(){return this._located||!1},webrtc:function(e){return e&&(this._webrtc=e),this},getMediaStream:function(){return void 0!==this.mediaStream?this.mediaStream:this._located?this._localMediaStream:this._webrtc&&(this._webrtc.getRemoteStream()||this._webrtc.getLocalStream())},requestFrame:function(){this._localMediaStream&&this._localMediaStream.getVideoTracks().forEach(function(e){"function"==typeof e.requestFrame&&e.requestFrame()})},getLocalMediaStream:function(){return this._localMediaStream},getRemoteMediaStream:function(){if(this._webrtc&&void 0!==this._webrtc.getRemoteStream())return this._webrtc.getRemoteStream()},mutedNeed:function(){return this.mutedMuted||!1},ifMediaStream:function(e){void 0===this.mediaStream?this._located&&void 0!==this._localMediaStream?e(this._localMediaStream):this._located||!this._webrtc||void 0===this._webrtc.getRemoteStream()||e(this._webrtc.getRemoteStream()):e(this.mediaStream)},subscribed:function(){return emedia.subscribed(this)},getHtmlDOMID:function(){return"_m_"+this.owner.id+"_s_"+this.id},MediaSoundMeter:o,StreamSoundMeter:r.prototypeExtend({__init__:function(){if(!this._stream||"function"!=typeof this._stream.getMediaStream)throw _logger.error("_stream empty or not found method getMediaStream"),"_stream empty or not found method getMediaStream";if(this._streamId=this._stream.id,this._streamCreateId=this._stream.__create_id,this._mediaStream=this._mediaStream,2===this._stream.type&&!this._stream.located()&&!this._webrtc)throw _logger.error("require webrtc. when type = 2 and not located"),"require webrtc. when type = 2 and not located";this.__mediaSoundMeter=this.__mediaSoundMeter||new o({__audioContext:this.__audioContext,_mediaStream:this._mediaStream}),this.__mediaSoundMeter.useCount=(this.__mediaSoundMeter.useCount||0)+1},onSoundMeters:function(e){var t={instant:0,slow:0,clip:0};if(this._stream.aoff)return this._finally(),e(t),t;if(2!==this._stream.type&&this._stream.subArgs&&void 0!==this._stream.subArgs.subSAudio&&!this._stream.subArgs.subSAudio)return this._finally(),e(t),t;if(0==this._stream.id||2===this._stream.type&&!this._stream.located()&&(!this._stream.subArgs||!this._stream.subArgs.subSAudio)){var n,i=this._webrtc.getReceiversOfPeerConnection();if(!i||0===i.length)return e(t),t;for(var o in i)"audio"===i[o].track.kind&&(n=i[o]);if(!n)return e(t),t;if("function"==typeof n.getContributingSources){var s,a=n.getContributingSources();if(emedia.config._printSoundData&&r.logger.debug(this._stream.id,this._stream.csrc,"rtpContributingSources ",a),!a||0===a.length)return e(t),t;for(var o in a)a[o].source==this._stream.csrc&&(s=this._stream.csrc);if(emedia.config._printSoundData&&r.logger.debug(this._stream.id,this._stream.csrc,"source ",s),void 0===s)return e(t),t}}var c=this.__mediaSoundMeter.getSoundMeters()||t,u=2===this._stream.type?this._webrtc:this._stream._webrtc;(emedia.meterWithTrackAudioLevel||0===c.instant)&&u&&!u.closed&&u._rtcPeerConnection&&u._rtcPeerConnection.getStats().then(function(t){t.size>0&&t.forEach(function(t){"track"!==t.type||"audio"!==t.kind&&"audio"!==t.trackIdentifier||(c.trackAudioLevel=t.audioLevel,c.trackTotalAudioEnergy=t.totalAudioEnergy,e(c))})}),e(c)},_finally:function(){2===this._stream.type&&this._stream.located()&&this._remoteMediaSoundMeters&&this._remoteMediaSoundMeters._finally(),this.__mediaSoundMeter.useCount--,0===this.__mediaSoundMeter.useCount&&this.__mediaSoundMeter._finally()}})})},function(e,t,n){"use strict";function r(e){this.context=e,this.instant=0,this.slow=0,this.clip=0,this.script=e.createScriptProcessor(2048,1,1);var t=this;this.script.onaudioprocess=function(e){var n,r=e.inputBuffer.getChannelData(0),i=0,o=0;for(n=0;n<r.length;++n)i+=r[n]*r[n],Math.abs(r[n])>.99&&(o+=1);t.instant=Math.sqrt(i/r.length),t.slow=.95*t.slow+.05*t.instant,t.clip=o/r.length}}r.prototype.connectToSource=function(e,t){console.log("SoundMeter connecting");try{this.mic=this.context.createMediaStreamSource(e),this.mic.connect(this.script),this.script.connect(this.context.destination),void 0!==t&&t(null)}catch(n){console.error(n),void 0!==t&&t(n)}},r.prototype.stop=function(){this.mic.disconnect(),this.script.disconnect()},e.exports=r},function(e,t,n){var r=n(15),i=r.tagLogger("Handler"),o=n(21),s=r.prototypeExtend({onEvent:function(e){var t=this;function n(){try{t.handleEvent(e)}catch(n){i.warn(n)}}if(e&&i.info("[EVT]",e.message(),e.hidden||""),e instanceof o.ServerRefuseEnter&&e.failed&&-95270===e.failed&&(e.failed=-9527),e instanceof emedia.event.StreamState&&e.stream&&e.stream.located())n();else try{e.hidden||t.onNotifyEvent&&t.onNotifyEvent(e)}finally{n()}},handleEvent:function(e){var t=this;if(e instanceof o.RecvResponse)t._onRecvResponse(e);else if(e instanceof o.ServerRefuseEnter)i.warn("Server refuse, ",e.failed,e.msg),t.onServerRefuseEnter(e);else if(e instanceof o.EnterFail)i.warn("Enter fail, result = ",e.failed),t.onEnterFail();else if(e instanceof o.WSClose)t.onWSClose();else if(e instanceof o.WSConnected)i.warn("Websocket connected");else if(e instanceof o.ICEConnected){var n=e.webrtc;t.onICEConnected(n)}else if(e instanceof o.ICEConnectFail){n=e.webrtc;t.onICEConnectFail(n)}else if(e instanceof o.ICEDisconnected){n=e.webrtc;t.onICEDisconnected(n)}else if(e instanceof o.ICEClosed){n=e.webrtc;t.onICEClosed(n)}else if(e instanceof o.ICERemoteMediaStream)t.onICERemoteMediaStream(e.webrtc);else if(e instanceof o.PushSuccess){t._cacheStreams[e.stream.id]=t._linkedStreams[e.stream.id]=e.stream;var s=t.newStream(e.stream);if(e.hidden&&!t._maybeNotExistStreams[e.stream.id]&&!s.isRepublished)return void t._onAddStream(s);t.isSafari()&&(emedia._isSafariYetPushedStream=!0);try{s&&t.onUpdateStream(s,new s.Update({voff:s.voff,aoff:s.aoff,mediaStream:s.getMediaStream()}))}finally{t.isSafari()&&r.forEach(t._cacheStreams,function(e,n){!0===n._autoSubWhenPushStream&&(r.removeAttribute(n,"_autoSubWhenPushStream"),t.createWebrtcAndSubscribeStream(n.id))})}}else if(e instanceof o.SubSuccess)t._linkedStreams[e.stream.id]=e.stream,e.stream._zoom=1;else if(e instanceof o.PushFail){if(!0!==e.hidden){var a=r.removeAttribute(t._linkedStreams,e.stream.id);if(i.warn("PushFail remove from _linkedStreams",e.stream.id,a),a){s=t.newStream(e.stream);t.onRemoveStream(s)}}}else if(e instanceof o.SubFail){if(!0!==e.hidden)r.removeAttribute(t._linkedStreams,e.stream.id),i.warn("SubFail remove from _linkedStreams",e.stream.id),(s=t.newStream(e.stream)).rtcId=void 0,s._webrtc=void 0,s.mediaStream=void 0,t.onUpdateStream(s,new s.Update(s))}else if(e instanceof o.SubFailNotSupportVCodes){var c=e.stream;i.warn("Rtc donot support pub VCodes. close. sub fail.",c.rtcId," -> ",c.id);try{t.onNotSupportPublishVideoCodecs&&t.onNotSupportPublishVideoCodecs(c)}catch(d){i.warn(d)}}else if(e instanceof o.EnterSuccess)t.onEnterSuccess();else if(e instanceof o.SwitchVCodes){c=e.stream;var u=e.useVCodes;n=c._webrtc;if(i.warn("Rtc switch VCodes. ",c.id,u),u&&0!=u.length||i.warn("Rtc switch VCodes. error! useVCodes is empty ",c.id,u),n&&n.optimalVideoCodecs){if("string"==typeof n.optimalVideoCodecs&&n.optimalVideoCodecs==u[0])return void i.warn("Rtc switch VCodes. igrone . useVCodes == optimalVideoCodecs ",c.id,n._rtcId,u);if(r.isArray(n.optimalVideoCodecs)&&n.optimalVideoCodecs.length>0&&n.optimalVideoCodecs[0]==u[0])return void i.warn("Rtc switch VCodes. igrone ddd . useVCodes == optimalVideoCodecs ",c.id,n._rtcId,u)}c.optimalVideoCodecs=u,n&&t.closeWebrtc(n.getRtcId(),!0),setTimeout(function(){c.iceRebuildCount=1,t.iceRebuild(c),i.warn("Rtc switch VCodes. iceRebuild end.",c.id,u)},300)}},_onRecvResponse:function(e){var t=e.request,n=e.response;if(t&&n&&200!==t.op&&1002!==t.op&&0!==n.result){i.warn("Server refuse. when request = ",t);var r=e.failed;switch(r){case-9527:case-95270:break;case-500:case-502:case-504:case-508:case-510:this.close(4,r);break;case-506:this.close(11,r);break;case-501:this.close(11,r)}}},onServerRefuseEnter:function(e){var t=e.failed;switch(t){case-9527:case-95270:this.close(4,-9527);break;case-500:case-502:case-504:case-508:case-510:this.close(4,t);break;case-506:this.close(11,t);break;default:this.close(2)}},onEnterFail:function(){this.__getCopyInterval&&clearInterval(this.__getCopyInterval)},onEnterSuccess:function(){var e=this;setTimeout(function(){e._failIcesRebuild()},200),e.getCopyIntervalMillis&&e.getCopyIntervalMillis>0&&(i.warn("Run interval get copy. interval = ",e.getCopyIntervalMillis),e.__getCopyInterval&&clearInterval(e.__getCopyInterval),e.__getCopyInterval=setInterval(function(){e._session.connected()?e._sysCopy.apply(e):(i.warn("Warn! cannot get copy. cause offline."),e.__getCopyInterval&&clearInterval(e.__getCopyInterval))},e.getCopyIntervalMillis)),e.getMediaMeterIntervalMillis&&e.getMediaMeterIntervalMillis>0&&e._intervalGetMediaMeters()},_intervalGetMediaMeters:function(){var e=this;!function t(){e.__getMediaMetersIntervalFlag&&emedia.cancelAnimationFrame(e.__getMediaMetersIntervalFlag),e.getMediaMeterIntervalMillis?e.__getMediaMetersIntervalFlag=emedia.requestAnimationFrame(function(n){"function"==typeof emedia.AudioContext&&e._flushMediaMetersByAudioContext.apply(e),!1===e.closed&&t()},e.getMediaMeterIntervalMillis):i.warn("Ontalking closed. please use getMediaMeterIntervalMillis")}()},_flushMediaMetersByAudioContext:function(){var e=this;r.forEach(e._cacheStreams,function(t,n){e._monitSoundChanagedStreams&&!e._monitSoundChanagedStreams[t]||"0"!=n.id&&e._updateMetersOrNewOne.call(e,t,n)});var t=[];r.forEach(e._mediaMeters,function(n,r){var i=e._cacheStreams[n];i&&e._updateMetersOrNewOne.call(e,n,i),i||t.push(n)}),r.forEach(t,function(t,n){r.removeAttribute(e._mediaMeters,n)})},_updateMetersOrNewOne:function(e,t){var n=this,i=n._mediaMeters[e];if(!(2!==t.type||t.located()||t.subArgs&&t.subArgs.subSAudio)){var o=n._oneAudioMixers();if(!o||i&&i._webrtc&&o._webrtc.__id!=i._webrtc.__id)return i&&i._finally(),r.removeAttribute(n._mediaMeters,e),void n._onSoundChanage.call(n,t.owner,t)}return i&&i._streamCreateId===t.__create_id&&i.__mediaSoundMeter.__worked?(i.onSoundMeters(function(e){n._onSoundChanage.call(n,t.owner,t,e)}),i):(i&&(i._streamCreateId!==t.__create_id||i.__mediaSoundMeter.__worked)&&(i&&i._finally(),r.removeAttribute(n._mediaMeters,e),n._onSoundChanage.call(n,t.owner,t)),t.aoff?void 0:((i=n._newMediaMeters(t))&&(n._mediaMeters[e]&&n._mediaMeters[e]._finally(),n._mediaMeters[e]=i),i))},_newAudioContext:function(){if(emedia.__usingWebAudio)return emedia.__audioContext},_newMediaMeters:function(e){var t;if(2===e.type&&e.subArgs&&e.subArgs.subSAudio&&e._webrtc&&e._webrtc.getRemoteStream())return new e.StreamSoundMeter({_stream:e,_mediaStream:e._webrtc.getRemoteStream(),_webrtc:e._webrtc,__audioContext:this._newAudioContext()});if(2===e.type&&e.located())return new e.StreamSoundMeter({_stream:e,_mediaStream:e._localMediaStream,__audioContext:this._newAudioContext()});if(2===e.type&&!e.located()){var n=this._oneAudioMixers();if(!n||!n._webrtc||n._webrtc.closed)return;if(n&&(void 0===n._remoteMediaSoundMeters||!n._remoteMediaSoundMeters.__worked)&&n._webrtc&&n._webrtc.getRemoteStream()&&(n._remoteMediaSoundMeters=new n.MediaSoundMeter({_mediaStream:n._webrtc.getRemoteStream(),__audioContext:this._newAudioContext()})),!n._remoteMediaSoundMeters)return;return new e.StreamSoundMeter({_stream:e,_webrtc:n._webrtc,__mediaSoundMeter:n._remoteMediaSoundMeters})}return!e.aoff&&(t=e.getMediaStream())?new e.StreamSoundMeter({_stream:e,_mediaStream:t,__audioContext:this._newAudioContext()}):void 0},_oneAudioMixers:function(){var e=this._cacheStreams[0];if(e&&e._webrtc&&!e._webrtc.closed)return e;for(var t in this.audioMixers){var n=this.audioMixers[t];if(n.located())return n}},onWSClose:function(){this.__getCopyInterval&&clearInterval(this.__getCopyInterval),i.info("Websocket closed.")},onICEDisconnected:function(e){var t=this;t.__networkWeakInterval&&clearTimeout(t.__networkWeakInterval),t.__networkWeakInterval=setTimeout(function(){t.onNetworkWeak&&t.onNetworkWeak()},1e3),r.forEach(t._linkedStreams,function(n,o){o.rtcId==e.getRtcId()&&(t._maybeNotExistStreams[n]||((t._maybeNotExistStreams[n]=r.extend({},o)).iceRebuildCount=1),i.info("Stream maybe not exist. caused by disconnected",o.id))})},onICEConnectFail:function(e){var t=this;for(var n in t._linkedStreams){var s=t._linkedStreams[n];if(s.rtcId==e.getRtcId()){if(s._webrtc&&s._webrtc.__id!==e.__id){i.warn("Stream use other webrtc rtcId = ",s.rtcId,", id: ",s._webrtc.__id,e.__id);continue}var a;if((a=t._maybeNotExistStreams[n])||((a=t._maybeNotExistStreams[n]=r.extend({},s)).iceRebuildCount=1),a){var c=new o.StreamState({stream:a});c.iceFail(),t.onEvent(c)}if(i.info("ice fail. webrtc = ",e.getRtcId()," problem stream is ",a.iceRebuildCount,a.id),a.iceRebuildCount>emedia.config.iceRebuildCount)i.info("ice fail. webrtc = ",e.getRtcId()," rebuild fail. problem stream is ",a.id),a.located()?t.onEvent(new o.PushFail({stream:s,cause:"pub ice rebuild failed."})):t.onEvent(new o.SubFail({stream:s,cause:"sub ice rebuild failed."})),t.closeWebrtc(e.getRtcId(),!1);else{var u=t._records[a.id];a._localMediaStream?i.info("ice fail. webrtc = ",e.getRtcId()," will rebuild. remain local stream. ",a.id):i.info("ice fail. webrtc = ",e.getRtcId()," will rebuild.",a.id),t.closeWebrtc(e.getRtcId(),!0),u&&(t._records[a.id]=u),function(e){setTimeout(function(){t.iceRebuild(e)},emedia.config.iceRebuildIntervalMillis)}(a),i.info("ice fail. webrtc = ",e.getRtcId()," will rebuilding. problem stream is ",a.id)}2===s.type&&r.removeAttribute(t.audioMixers,s.id)}}},onICEClosed:function(e){if(e.closed){i.warn("Webrtc will be removed. by __id = ",e.__id,", rtcId = ",e.getRtcId());var t=r.removeAttribute(this._ices,e.__id);t?i.warn("Webrtc removed. by id = ",t.__id,", rtcId = ",t.getRtcId()):i.warn("Webrtc removed. by id = ",e.__id,", rtcId = ",e.getRtcId());var n=this._ices[e.getRtcId()];n&&n.__id===t.__id&&(t=r.removeAttribute(this._ices,e.getRtcId()),i.warn("Webrtc removed. by rtcId = ",t.getRtcId(),", __id = ",t.__id))}else i.info("ICE self closed. not allow. will rebuild",e.getRtcId()),this.onICEConnectFail(e)},onICEConnected:function(e){var t=this;r.forEach(t._cacheStreams,function(n,s){if(s.rtcId==e.getRtcId()){if(s.finalVCodeChoices=e.finalVCodeChoices,t._maybeNotExistStreams[n]){r.removeAttribute(t._maybeNotExistStreams,s.id),t._linkedStreams[n]=s,i.info("ice reconnected. webrtc = ",e.getRtcId(),"will update stream = ",s.id);var a=t._records[s.id];a&&a.rtcId!==s.rtcId&&(t.startRecord(s),i.warn("Re record. for ",s.id,", after rebuild ice.",a.rtcId,"->",s.rtcId))}else i.info("ice connected. webrtc = ",e.getRtcId(),s.id),s.located()&&t.onEvent(new o.PushSuccess({stream:s})),s.located()||t.onEvent(new o.SubSuccess({stream:s}));2===s.type&&(t.audioMixers[s.id]=s)}})},onICERemoteMediaStream:function(e){var t=this;r.forEach(t._cacheStreams,function(n,r){if(r.rtcId==e.getRtcId()&&(!r.located()||2===r.type)){var i=e.getRemoteStream();if(t._updateRemoteStream(r,i),r.onGotRemoteMediaStream)r.onGotRemoteMediaStream.call(r,i);else(r=t.newStream(r)).mediaStream=e.getRemoteStream(),t.onUpdateStream(r,new r.Update({mediaStream:r.mediaStream}))}})},_failIcesRebuild:function(){var e=this;r.forEach(e._maybeNotExistStreams,function(t,n){setTimeout(function(){e.iceRebuild(n)},100)})},iceRebuild:function(e){return this.connected()?this._linkedStreams[e.id]&&this._cacheStreams[e.id]?void(e.iceRebuildCount>emedia.config.iceRebuildCount?(i.info("ice rebuild fail. count too many. stream is ",e.id),e.located()?this.onEvent(new o.PushFail({stream:e,cause:"pub ice rebuild failed."})):this.onEvent(new o.SubFail({stream:e,cause:"sub ice rebuild failed."}))):this.connected()?(i.info("ice try rebuild. count",e.iceRebuildCount,". stream is ",e.id),this.rebuildIce(e),e.iceRebuildCount++):i.warn("ice rebuild. stop. cause by not websocket disconnect",e.id)):(i.info("ice rebuild fail. it yet closed. stream is ",e.id,e.rtcId),r.removeAttribute(this._maybeNotExistStreams,e.id),r.removeAttribute(this._linkedStreams,e.id),void i.warn("iceRebuild, remvoe from _linkedStreams",e.id)):(e.iceRebuildCount=1,void i.warn("Websocket disconnect. waiting. rebuild count reset",e.iceRebuildCount,e.id))},rebuildIce:function(e){this._cacheStreams[e.id]?(i.warn("Begin rebuild ice ",e.iceRebuildCount,e.id),e.located()?(e.isRepublished=!0,this.push(e,void 0,void 0,!0)):this.createWebrtcAndSubscribeStream(e.id),i.warn("Finish rebuild ice ",e.iceRebuildCount,e.id,this._cacheStreams[e.id].rtcId)):i.warn("Begin rebuild ice. not found stream at local",e.iceRebuildCount,e.id)},_sysCopy:function(){var e=this,t=e.newMessage().setOp(1e3).setCver(e._cver||0);e.postMessage(t,function(t){0==t.result?(e._cver||0)<t.cver&&(e._cver=t.cver,e.onMembers(t.cver,t.mems||{}),e.onStreams(t.cver,t.streams||{}),i.info("Got copy success.")):i.warn("Get copy fail. result = ",t.result)})}});e.exports=s},function(e,t,n){var r=n(15),i=r.tagLogger("Desktop"),o=n(21);window.__shareDesktopMessageCount__=0,e.exports=r.prototypeExtend({__RTC_PAGE_MSG_TYPE__:"RTC-SD-PAGE",__RTC_EXT_MSG_TYPE__:"RTC-SD-EXT",__init__:function(){var e=this;e.__extLoaded=e.rsdExtLoaded(),e.__extLoaded&&e.__onRsdExtLoad(),window.addEventListener("load",function(t){if(!e.__extLoaded){var n=e.rsdExtLoaded();e.__extLoaded=n}}),window.addEventListener("message",function(t){if(t.data){var n=t.data;n.type&&n.type===e.__RTC_EXT_MSG_TYPE__&&n.evname&&(i.info("got ext-msg: ",n),"extLoaded"!==n.evname?e.__onMessage(n):e.__extLoaded||(e.__extLoaded=!0,setTimeout(e.__onRsdExtLoad(),50)))}})},rsdExtLoaded:function(){var e=document.getElementById("RTC-Share-Deskto-installed-ele-rat1abrr");return!(!emedia.isElectron&&!e)},__sendMessage:function(e,t){var n=this,o="tsx_"+__shareDesktopMessageCount__+++"_"+Math.random().toString(36).substr(2,4);if(!n.__extLoaded)throw i.error("Rtc share desktop not loaded"),"Rtc share desktop not loaded";e.tsxId=o,n["on_"+o]=function(){t&&t.apply(n,arguments),r.removeAttribute(n,"on_"+o)},window.postMessage&&window.postMessage(e,"*")},__onMessage:function(e){var t=e.tsxId;this["on_"+t]&&this["on_"+t](e)},__onRsdExtLoad:function(){this.onExtLoaded&&this.onExtLoaded()},openDesktopMedia:function(e,t){if(emedia.isElectron)this.openDesktopMediaInElectron(e,t);else if(this.__extLoaded&&this.rsdExtLoaded()){var n={type:this.__RTC_PAGE_MSG_TYPE__,evname:"chooseDesktopMedia",screenOptions:e};this.__sendMessage(n,function(e){"onAccessApproved"===e.evname&&e.streamId?t(new o.OpenDesktopMedia({desktopStreamId:e.streamId})):t(new o.OpenDesktopMediaAccessDenied)})}else t(new o.ShareDesktopExtensionNotFound)},openDesktopMediaInElectron:function(e,t){e||(e=["screen","window"]),emedia.electron.desktopCapturer.getSources({types:e},function(e,n){if(e)t(new o.OpenDesktopMediaAccessDenied({error:e}));else if("function"==typeof emedia.chooseElectronDesktopMedia){for(var r=0;r<n.length;r++){i.debug("desktop capturer. ",n[r]);var s=n[r];s.easemobThumbDataURL=s.thumbnail.toDataURL()}emedia.chooseElectronDesktopMedia(n,function(e){var n;n=e&&e.id?e.id:e,t(new o.OpenDesktopMedia({desktopStreamId:n}))},function(){t(new o.OpenDesktopMediaAccessDenied({message:"User denied access"}))})}else t(new o.OpenDesktopMedia({desktopStreamId:n[0].id}))})}})},function(e,t,n){var r,i=n(15).tagLogger("DefaultTrack"),o=n(31);e.exports=r=o.extend({__init__:function(){var e,t;this._canvas||(this._canvas=(e=this._target,t=document.createElement("canvas"),e.appendChild(t),t.style.cssText="position: absolute; background: transparent; width: 100%; height: 100%",t.width=e.offsetWidth,t.height=e.offsetHeight,i.warn("Canvas",t.width,t.height),t)),this._canvasContext||(this._canvasContext=this._canvas.getContext("2d"))},resizeCanvas:function(){},_calPosition:function(){var e=o.prototype._calPosition.apply(this,arguments);return e.x=Math.floor(e.x*this._canvas.width/e.width),e.y=Math.floor(e.y*this._canvas.height/e.height),e},_draw:function(e,t,n,r,i,o){var s=this._canvasContext;(!t||t<=1)&&(t=2);var a=s.getImageData(e.x-t/2,e.y-t/2,t,t);a&&function(e,t,n,r,i){for(var o=0,s=e.data;o<s.length;o+=4){var a={r:void 0===t?s[o]:t,g:void 0===n?s[o+1]:n,b:void 0===r?s[o+2]:r,alpha:void 0===i?s[o+3]:i};s[o]=a.r,s[o+1]=a.g,s[o+2]=a.b,s[o+3]=a.alpha}}(a,n,r,i,o),s.putImageData(a,e.x,e.y)},redraw:function(e,t,n,i,o,s){r.prototype._draw.bind(this)({x:e,y:t},2)},onMouseTrigger:function(e,t){e.isLeftKey()&&this._draw(e.xy,8,189,56,51,255),e.isRightKey()&&this._draw(e.xy,8,45,23,189,255),e.isWheelKey()&&this._draw(e.xy,8,58,189,76,255)},onMouseTrack:function(e,t,n){this._draw(e,2,227,18,247,255)}})},function(e,t,n){var r=n(15),i=(r.tagLogger("MouseTrack"),n(32));e.exports=r.prototypeExtend({_scale:1,__init__:function(){},getTargetPageXY:function(){return this._target&&r.extend({},r.getDomPageRect(this._target))},onMouseTrack:function(e,t,n){},onMouseTrigger:function(e,t){},_onMouseTrack:function(e,t,n){this.onMouseTrack&&this.onMouseTrack(e,t,n)},_onMouseTrigger:function(e,t){this.onMouseTrigger&&this.onMouseTrigger(e,t)},track:function(e){var t=e=r.extend({},e),n=this.getTargetPageXY();n&&(t={x:(e=this._calPosition(e)).x,y:e.y,pageX:n.x+e.x,pageY:n.y+e.y}),this._onMouseTrack(t,this._lastPageXY,this._lastTrigger),this._lastPageXY=t},trigger:function(e){e=new i(e);var t,n=this.getTargetPageXY();n&&(t=this._calPosition(e.xy),e.xy={x:t.x,y:t.y,pageX:n.x+t.x,pageY:n.y+t.y}),e._time||(e._time=(new Date).getTime()),this._onMouseTrigger(e,this._lastTrigger),this._lastTrigger=e},releaseTrigger:function(){this._lastTrigger=void 0,this._lastPageXY=void 0,this.onReleaseTrigger&&this.onReleaseTrigger(this._lastTrigger)},_calPosition:function(e){this._referenceVideo&&(e=emedia.Service.prototype.eventXYAtVideo.call(null,e,this._referenceVideo));var t=this.getTargetPageXY();if(!t)return e;r.isFloat(e.x)&&void 0!==e.width&&(e.x=e.x*e.width*this._scale*(t.width/e.width)),r.isFloat(e.y)&&void 0!==e.height&&(e.y=e.y*e.height*this._scale*(t.height/e.height)),r.isFloat(e.x)&&void 0===e.width&&(e.x=e.x*this._scale*t.width),r.isFloat(e.y)&&void 0===e.height&&(e.y=e.y*this._scale*t.height),r.isInt(e.x)&&void 0!==e.width&&(e.x=e.x*this._scale*(t.width/e.width)),r.isInt(e.y)&&void 0!==e.height&&(e.y=e.y*this._scale*(t.height/e.height)),r.isInt(e.x)&&void 0===e.width&&(e.x=e.x*this._scale),r.isInt(e.y)&&void 0===e.height&&(e.y=e.y*this._scale);var n=Math.floor(e.x),i=Math.floor(e.y);return n<0&&(n=t.width+n),i<0&&(i=t.width+i),{x:n,y:i,width:t.width,height:t.height}}})},function(e,t,n){var r=n(15),i=(r.tagLogger("MouseTrigger"),{LEFT:1,WHEEL:2,RIGHT:4,WHEEL_ROLL_UP:8,WHEEL_ROLL_DOWN:16,KEY_UP:0,KEY_DOWN:1,MOVE:2,KEYBOARD_DOWN:3,KEYBOARD_UP:4});e.exports=r.prototypeExtend({_timeoutMillis:500,_time:(new Date).getTime(),isKeyup:function(){return i.KEY_UP==this.oper},isKeydown:function(){return i.KEY_DOWN==this.oper},isWheelup:function(){return i.WHEEL_ROLL_UP==this.btn},isWheeldown:function(){return i.WHEEL_ROLL_DOWN==this.btn},isLeftKey:function(){return i.LEFT==this.btn},isRightKey:function(){return i.RIGHT==this.btn},isWheelKey:function(){return i.WHEEL==this.btn},isWheelRoll:function(){return this.isWheeldown()||this.isWheelup()},timeout:function(){return(new Date).getTime()-this._time>=this._timeoutMillis},_toString:function(){return r.list("btn:",this.btn,", oper:",this.oper,", timeout:",this.timeout(),", at (",this.xy.x,", ",this.xy.y,")").join("")}}),e.exports.BTN=i},function(e,t,n){var r=n(15),i=r.tagLogger("AddonsP2P"),o=n(21);e.exports=function(e){return function(e,t,n){return e.extend({Session:t,Attendee:n,__init__:function(){e.prototype.__init__.call(this),void 0!==this.useRTCCfg&&!1!==this.useRTCCfg&&null!==this.useRTCCfg||(this.useRTCCfg=emedia.config.forceUseRTCCfgIfServerReturnWhenP2P)},push:function(t,n,r){if(this.current&&this.current.isP2P()){if(2===t.type)throw i.error("P2P do not allow audio_mixer"),"P2P do not allow audio_mixer";t instanceof this.AVPubstream&&!t.rtcId&&(this.current._cacheStreams["rtc-"+this.current.ticket.confrId+"__Caller"]||this.current._cacheStreams["rtc-"+this.current.ticket.confrId+"__Callee"]||(t.rtcId="rtc-"+this.current.ticket.confrId))}e.prototype.push.call(this,t,n,r)},newSession:function(t,n){var s=this,a=e.prototype.newSession.call(s,t,n),c=a.onTermC,u=a.onAnsC;return r.extend(a,{onInitC:function(e){if(t.isP2P()){if(e.rtcId==="rtc-"+t.ticket.confrId){var n=e.rtcId+(t.isCaller()?"__Callee":"__Caller");if((i=t._cacheStreams[n])&&i.owner&&i.owner.id!==e.memId)return t.rejectAnswer(e.memId,e.rtcId,10),void t.postMessage(t.newMessage({op:1001,memId:e.memId,tsxId:e.tsxId,result:-554,msg:"Other device call it. you no."}))}var i;e.pubS.sdp=e.sdp,e.pubS.cands=e.cands,e.pubS.id=e.rtcId+(t.isCaller()?"__Callee":"__Caller"),e.pubS._located=!1,e.pubS.memId=e.memId,e.pubS.rtcId=e.rtcId,e.pubS.sver=0,(i=t._cacheStreams[e.pubS.id])&&(e.pubS.sver=i.sver+1,r.removeAttribute(t._maybeNotExistStreams,e.pubS.id)),t.onPub.call(t,++t._cver,e.memId,e.pubS)}},onTermC:function(e){if(t.isP2P()){if(-20===e.endReason){var n=t._cacheStreams[e.rtcId+"__Caller"];return i.warn("Begin re-publish. 20",n),void(n&&s._republish(n))}if(e.memId&&e.memId!==t.getMemberId()){var a=[];return r.forEach(t._cacheStreams,function(e,t){a.push(t)}),a=a.sort(function(e,n){var r=-1;return e.id>n.id&&(r=1),t.isCallee()?0-r:r}),void r.forEach(a,function(n,r){r&&r.owner&&r.owner.id===e.memId&&e.rtcId===r.rtcId&&(-10!==e.endReason&&c.call(t,e),e.rtcId==="rtc-"+t.ticket.confrId&&t.onUnpub(++t._cver,e.memId,r.id),10===e.endReason&&t.onEvent(new o.OtherDeviceAnswer({rtcId:e.rtcId,stream:r}))),r&&r.owner&&r.owner.id===t.getMemberId()&&e.rtcId===r.rtcId&&(t.closeWebrtc(e.rtcId),t.onUnpub(++t._cver,r.owner.id,r.id))})}-10!==e.endReason&&c.call(t,e),10===e.endReason&&t.onEvent(new o.OtherDeviceAnswer({rtcId:e.rtcId}))}else c.call(t,e)},onAnsC:function(e){if(t.isP2P())if(t.__cache_[e.rtcId]){if(!0===t.__cache_[e.rtcId].answered)return i.warn("Webrtc ",e.rtcId,"had been ansC"),t.rejectAnswer(e.memId,e.rtcId,10),void t.postMessage(t.newMessage({op:1001,memId:e.memId,tsxId:e.tsxId,result:-554,msg:"Other device sub it. you no."}));try{if(e.pubS){var n=t.newStream(e.pubS);n._webrtc=t._ices[e.rtcId],n.rtcId=e.rtcId,n.id=e.rtcId+(t.isCaller()?"__Callee":"__Caller"),n.owner=t._cacheMembers[e.memId],t._cacheStreams[n.id]?t._cacheStreams[n.id]=n:t.onPub.call(t,++t._cver,e.memId,n),t.onEvent(new o.SubSuccess({stream:n,hidden:!0}))}var s=t._cacheMembers[e.memId];u.call(t,e),r.forEach(t._cacheMembers,function(n,r){n!==e.memId&&s.memName===r.memName&&t.rejectAnswer(n,e.rtcId,10)})}finally{t.__cache_[e.rtcId].answered=!0}}else i.warn("Webrtc ",e.rtcId,"not created. drop the answer");else u.call(t,e)}})}})}(e,function(e){var t=e.extend({postMessage:function(t,n){var r=this,i=t.tsxId;t.tsxId||(i=t.tsxId="MSG"+Date.now()+"-"+emedia.__session_globalCount++),e.prototype.postMessage.call(r,t,n),function(e){r.owner.isP2P()&&r._callbacks[e]&&setTimeout(function(){var t=r._callbacks[e];if(t&&1004===t.op){var n=r.newMessage({op:1001,tsxId:t.tsxId,memId:t.memId,result:0,msg:"3000ms not recv response. will success callback. "+t.tsxId});r.onMessage(n)}},3e3)}(i)},__modifyMessageForPost:function(t){var n=this;t=e.prototype.__modifyMessageForPost.call(n,t);var i=n.owner;if(i.isP2P()){if(102===t.op||105===t.op){var o=n.newMessage({op:1001,tsxId:t.tsxId,memId:t.memId,result:0,streamId:t.rtcId+(i.isCaller()?"__Caller":"__Callee"),sver:1});if(setTimeout(function(){n.onMessage(o)},100),!t._cached_){var s=r.extend({_cached_:!0},t);r.removeAttribute(s,"tsxId"),102===t.op&&(i.__cache_[t.rtcId]=[]).push(s),105===t.op&&i.__cache_[t.rtcId]&&i.__cache_[t.rtcId].push(s),i.__cache_[t.rtcId]&&(i.__cache_[t.rtcId].selfId=i.getMemberId())}}switch(r.removeAttribute(t,"_cached_"),t.memId&&(t=n.newMessage({op:1004,sessId:r.removeAttribute(t,"sessId"),memId:r.removeAttribute(t,"memId"),tsxId:r.removeAttribute(t,"tsxId"),arg:JSON.stringify(t)})),t.op){case 205:return o=n.newMessage({op:1001,tsxId:t.tsxId,result:0}),void setTimeout(function(){n.onMessage(o)},50);case 102:case 104:case 105:case 106:case 107:if(-10===t.endReason)return;case 1001:case 400:t=n.newMessage({op:1004,sessId:r.removeAttribute(t,"sessId"),tsxId:r.removeAttribute(t,"tsxId"),arg:JSON.stringify(t)});break;case 303:case 206:return}}return t},onP2PMessage:function(e){var t=this,n=t.owner;if(t.owner.isConfr())i.warn("Recv p2p ctrl message. when CONFR. ignore");else{var o=JSON.parse(e.arg);if(o.memId=e.memId,o.tsxId=e.tsxId,o.sessId=e.sessId,400===o.op&&(o.streamId=o.rtcId+(t.owner.isCaller()?"__Callee":"__Caller")),1001!==o.op){var s=t.newMessage({op:1001,tsxId:e.tsxId,memId:e.memId,sessId:e.sessId,result:0,msg:"Web sdk success recv"});102!==o.op&&105!==o.op||r.extend(s,{streamId:o.rtcId+(n.isCaller()?"__Callee":"__Caller"),sver:1}),t.postMessage(s)}!function(e){setTimeout(function(){t.onMessage(e)},10)}(o)}}});return r.extend(t.prototype._events,{1004:"onP2PMessage"}),t}((e.prototype.Session||n(20)).extend({})),function(e){return e.extend({__init__:function(){e.prototype.__init__.call(this),this.__cache_={};var t=this.iceRebuild;this.iceRebuild=function(e){this.isP2P()&&e.rtcId?e._webrtc&&!0===e._webrtc.answerWebrtc?i.warn("Stream not auto iceRebuild. caused by answer webrtc. it = ",e.id,e):e.located()?t.call(this,e):i.warn("Stream not auto iceRebuild. caused by not located. it = ",e.id,e):t.call(this,e)}},onEnter:function(t,n){var i=this;try{e.prototype.onEnter.call(i,t,n)}finally{if(!i.isP2P()||!(n=i._cacheMembers[n.id]))return;r.forEach(i.__cache_,function(e,t){!0!==t.answered&&r.forEach(t,function(e,t){!function(e){e.memId=n.id,i.postMessage(e)}(t)})})}},rejectAnswer:function(e,t,n,r){var i=this,s=i.newMessage().setOp(107).setRtcId(t).setMemId(e).setEndReason(n);i.postMessage(s,function(e){if(0!=e.result)return i.onEvent(new o.RspFail({request:s,response:e})),void(r&&r(new o.RspFail({request:s,response:e})))})},closeWebrtc:function(t,n,o){var s=this,a=!1;if(s.isP2P()){var c=s._ices[t];c&&(a=(a="failed"===c.iceConnectionState())&&c._rebuildCount<emedia.config.iceRebuildCount,i.warn("Webrtc state failed. it is ",t,c._rebuildCount,emedia.config.iceRebuildCount,c.__id))}if(e.prototype.closeWebrtc.call(s,t,n,o||a),s.isP2P()&&!o&&a&&r.forEach(s._cacheStreams,function(e,n){n.rtcId===t&&(s._linkedStreams[e]=n,i.warn("Reput stream to _linkedStreams",e))}),s.isP2P()&&!n){r.removeAttribute(s.__cache_,t);var u=r.extend({},s._cacheStreams);r.forEach(u,function(e,n){if(t===n.rtcId){r.removeAttribute(s._linkedStreams,n.id);var o=r.removeAttribute(s._cacheStreams,n.id);i.warn("P2P close webrtc. remove stream from _cacheStreams. it = ",n.id,n),o._localMediaStream&&s._service._stopTracks(o._localMediaStream),s.onRemoveStream&&(n=s.newStream(n),s.onRemoveStream(n))}})}},subscribeStream:function(t,n,r,s){if(this.isP2P()){var a=this._ices[t],c=this._cacheStreams[n];if(c._webrtc=a,c.rtcId=t,c.subArgs,s=s||{subSVideo:!0,subSAudio:!0},c.subArgs=c.subArgs||{subSVideo:!0,subSAudio:!0},c._webrtc&&(c._webrtc.subArgs=c._webrtc.subArgs||{subSVideo:!0,subSAudio:!0}),!c.subArgs.subSVideo&&s.subSVideo&&c.voff)throw i.error("Sub not allow. stream voff"),"Sub not allow. stream voff";if(!c.subArgs.subSAudio&&s.subSAudio&&c.aoff)throw i.error("Sub not allow. stream aoff"),"Sub not allow. stream aoff";if(c.subArgs.subSVideo&&!s.subSVideo&&!c.voff&&emedia.isSafari)throw i.error("Sub not allow. safari close sub video. will error"),"Sub not allow. safari close sub video. will error";s&&c._webrtc&&c._webrtc.setSubArgs(s),s&&(c.subArgs=s);var u=new o.SubSuccess({stream:c,hidden:!0});this._updateRemoteStream(c,c._webrtc.getRemoteStream()),this.onEvent(u)}else e.prototype.subscribeStream.call(this,t,n,r,s)},unsubscribeStream:function(t){this.isP2P()||e.prototype.unsubscribeStream.call(this,t)},onPub:function(t,n,r){if(this.isP2P())return e.prototype.onPub.call(this,t,n,r);e.prototype.onPub.call(this,t,n,r)},onStreams:function(t,n){this.isP2P()?i.warn("P2P ingrone the onStreams"):e.prototype.onStreams.call(this,t,n)},_howDoWebrtcWhenCrtExsitsWebrtc:function(t){this.isP2P()?this.closeWebrtc(t.getRtcId(),!0,!0):e.prototype._howDoWebrtcWhenCrtExsitsWebrtc.call(this,t)},createWebrtcAndSubscribeStream:function(t,n,s,a){if((c=this).isP2P()){var c;n||(n={});var u=(c=this)._cacheStreams[t],d=c._cacheMembers[u.owner.id],l=u;a=a||l.subArgs||{subSVideo:!0,subSAudio:!0};var f=u.vcodes,p=d.vcodes,h=c.supportVCodes,m=c._getOptimalVideoCodecsSubset(f,p,h);a=a||l.subArgs;var v=l.subArgs,b=!(l.vcodes&&l.vcodes.length>0),g={offerToReceiveAudio:!0,offerToReceiveVideo:a.subSVideo&&b};g.offerToReceiveAudio||g.offerToReceiveVideo||i.warn("offerToReceiveAudio == false and offerToReceiveVideo == false");var _=c.createWebrtc({_rtcId:l.rtcId,iceServerConfig:s,optimalVideoCodecs:m,offerOptions:g,onGotMediaStream:function(e){var t=new o.SubSuccess({stream:l,hidden:!0});n.onGotRemote&&n.onGotRemote(l),c.onEvent&&c.onEvent(t)}},l.iceRebuildCount),y=_.getRtcId();i.warn(y," sub stream ",t,m);var S=l._webrtc;if(l._webrtc=_,l.rtcId=y,l.owner=r.extend({},d),c._ices[y]=_,_.answerWebrtc=!0,a&&l._webrtc&&l._webrtc.setSubArgs(a),a&&(l.subArgs=a),y==="rtc-"+c.ticket.confrId){c.__lastCalleePub;var w=c._cacheStreams[y+(c.isCaller()?"__Caller":"__Callee")];w=new c._service.AVPubstream(w||{constaints:{audio:!l.aoff,video:!l.voff}}),S&&S.getLocalStream()&&c._service._stopTracks(S.getLocalStream()),c._service.openUserMedia(w).then(function(){var e=c.newStream(w);e._localMediaStream=w.localStream,e._webrtc=_,e.rtcId=_.getRtcId(),e.id=y+(c.isCaller()?"__Caller":"__Callee"),e.owner={id:c.getMemberId(),nickName:c.nickName,name:c.sysUserId,ext:c.extObj},c.onEvent(new o.PushSuccess({stream:e,hidden:!0})),C(w.localStream),c.answerCall(y,w,x)},x)}else C(),c.answer(y,x)}else e.prototype.createWebrtcAndSubscribeStream.call(c,t,n,s,a);function x(e){i.warn("sub stream error",t,e),v&&l._webrtc&&l._webrtc.setSubArgs(v),v&&(l.subArgs=v),e=new o.SubFail({stream:l,hidden:!0===e.hidden,cause:e}),n&&n.onEvent&&n.onEvent(e),c.onEvent&&c.onEvent(e)}function C(e){e&&_.setLocalStream(e),_.setRemoteDescription(l.sdp),l.cands&&l.cands.length>0&&_.addIceCandidate(l.cands)}}})}((e.prototype.Attendee||n(22)).extend({})))}},function(e,t,n){"use strict";n.r(t),n.d(t,"outer",function(){return u});var r=n(35),i=n(17),o=n.n(i),s=n(6),a=n.n(s),c={};r.single.onMemberJoin=function(e,t){emedia.decodeMemeberName(e),this.onMemberJoined(e,r.single._confr(t))},r.single.onMemberLeave=function(e,t,n){emedia.decodeMemeberName(e),this.onMemberExited(e,t,r.single._confr(n))},r.single._onRoleUpdated=function(e,t){this.onRoleChanged(e,r.single._confr(t))},r.single._onAddMemberStream=function(e,t){e&&emedia.decodeMemeberName(e.owner),this.onStreamAdded(e.owner,e,r.single._confr(t))},r.single._onRemoveMemberStream=function(e,t){e&&emedia.decodeMemeberName(e.owner),this.onStreamRemoved(e.owner,e,r.single._confr(t))},r.single._onUpdateMemberStream=function(e,t,n){e&&emedia.decodeMemeberName(e.owner),this.onStreamUpdated&&this.onStreamUpdated(e.owner,e,t,r.single._confr(n))},r.single.onExit=function(e,t,n){this.onConferenceExit(e,t,r.single._confr(n))},c.onMemberJoined=function(e){},c.onMemberExited=function(e,t){},c.onRoleChanged=function(e){},c.onStreamAdded=function(e,t){},c.onStreamRemoved=function(e,t){},c.onConferenceExit=function(e,t){},c.joinConferenceWithTicket=r.single.joinUseTicket,c.joinConference=r.single.joinUsePassword,c.getConferenceTkt=r.single.reqTkt,c.publish=function(e,t,n){return r.single.shareVideoWithAudio(e.video,e.audio,t,n)},c.unpublish=function(e){return r.single.hungup(e)},c.unsubscribe=function(e){return r.single.hungup(e)},c.exitConference=function(e){return r.single.exit(e||!1)},c.getConferenceInfo=function(e,t){return r.single.selectConfr(e,t)},c.createConference=r.single.createConfr,c.grantRole=function(e,t,n){return emedia.decodeMemeberName(t),r.single.chanageRoles(n,t,e.id)},c.kickMembersById=function(e,t){return emedia.decodeMemeberName(t),r.single.kickMember(t,e.id)},c.destroyConference=function(e){return r.single.disbandConfr(e,e.roleToken)},emedia.decodeMemeberName=function(e){if("function"!=typeof emedia.decodeMemeberNameString)return e;if("string"==typeof e)return emedia.decodeMemeberNameString(e);if(o.a.isArray(e)){for(var t=0;t<e.length;t++)e[t]=emedia.decodeMemeberName(e[t]);return e}return e.name?(e.globalName=e.name,void(e.memName=e.name=emedia.decodeMemeberName(e.name))):e.memName?(e.globalName=e.memName,void(e.memName=e.name=emedia.decodeMemeberName(e.memName))):void 0},emedia.ConfrType=r.single.ConfrType,emedia.Role=r.single.Role,a()(function(){var e=window.WebIM;if(e&&e.conn&&"function"==typeof e.conn.onOpened){var t=function(){emedia.decodeMemeberNameString=function(t){if("string"==typeof t){if(t.indexOf(e.conn.orgName)<0)return t;var n=t.indexOf("_");n<0?n=0:n++;var r=t.indexOf("@");return r<0&&(r=t.length),t.substring(n,r)}return t},r.single.setUrlCreator(function(t,n){return e.conn.apiUrl+t}),r.single.setIdentity(e.conn.orgName+"#"+e.conn.appName+"_"+e.conn.user+"@"+e.conn.domain,e.conn.token)},n=e.conn.onOpened;e.conn.onOpened=function(){n.apply(e.conn,arguments),t()},e.conn.token&&t()}});var u=o.a.extend(r.single,c)},function(e,t,n){"use strict";n.r(t),n.d(t,"single",function(){return R});var r=n(15),i=n.n(r),o=n(6),s=n.n(o),a=n(17),c=n.n(a),u=n(36),d=n(135),l=n(26),f=n.n(l),p=i.a.tagLogger("mgr");window.emedia=window.emedia||{};function h(){this._confrs={},this._services={},this._events={},this._videos={}}h.prototype.ConfrType={COMMUNICATION:10,COMMUNICATION_MIX:11,LIVE:12,P2P:13,INTERCOMM:14},h.prototype.Role={ADMIN:7,TALKER:3,AUDIENCE:1};var m;m={createConfr:"/easemob/rtc/req/ticket",reqTkt:"/easemob/rtc/req/ticket",chanageRoles:"/easemob/rtc/chanage/roles",disbandConfr:"/easemob/rtc/disband/conference",kickMember:"/easemob/rtc/kick/member",selectConfr:"/easemob/rtc/select/confr"},i.a.forEach(m,function(e,t){h.prototype[e]=function(n){return r=this.createUrl(t,e),o=n,function(e){s.a.ajax({type:"POST",url:r,data:JSON.stringify(o),contentType:"application/json",dataType:"json",success:function(t,n,s){p.debug("REST: ",t," -> ",o,r),0===t.error?(i.a.removeAttribute(t,"error"),e.next(t),e.complete()):(i.a.extend(t,{errorType:"server_refuse"}),e.error(t))},error:function(t,n,i){var s={errorType:"http_error",error:t.status,errorMessage:i};p.debug("REST: ",s," -> ",o,r),e.error({errorType:"http_error",error:t.status,errorMessage:i})}})};var r,o}}),h.prototype.createUrl=function(e,t){return e},h.prototype.setUrlCreator=function(e){this.createUrl=e.bind(this)},h.prototype.destroy=function(){},h.prototype.ZeroStream=f.a.extend({__init__:function(){this.type=2,this.id="0",this._located=!1,this.mutedMuted=!1},onGotRemoteMediaStream:function(e){if(!this.remotePlayAudioObject){this.id;var t=document.createElement("audio");t.style.display="none",t.id="__o_remote_play_audio_"+this.id,t.autoplay=!0,t.playsinline=!0,this.remotePlayAudioObject=t,document.body.appendChild(t)}this.remotePlayAudioObject.srcObject=e}}),h.prototype.setIdentity=function(e,t,n){this.identityName=e,this.identityToken=t,this.ext=n,this._terminalInfo={browser:emedia.browser,browserVersion:emedia.browserVersion,version:emedia.config.version,userAgent:emedia.config.userAgent},p.info("set identity: ",e,t),this.destroy(),emedia.config({autoSub:!1,onlyEnter:!0})},h.prototype.EventsObservable=n(235).default;var v=Object(d.catchError)(function(e,t){throw p.error(e),e});function b(e,t){var n=this,r={uid:n.identityName,token:n.identityToken,confrId:e,password:t,terminal:n._terminalInfo};return n._confrs[e]&&(r.roleToken=n._confrs[e].roleToken),u.Observable.create(h.prototype.reqTkt.call(n,r)).pipe(Object(d.map)(function(t){return t.mixed=11===t.type||12===t.type,t.id=t.serverConfrId=t.confrId=e,n._confrs[e]=i.a.extend(n._confrs[e]||{},t),i.a.removeAttribute(t,"rtcCfg"),t}),v)}function g(e,t){var n=this._confr(e),r={uid:this.identityName,token:this.identityToken,confrId:e,password:t};return n&&(r.password=t||n.password,r.roleToken=n.roleToken),u.Observable.create(h.prototype.selectConfr.call(this,r)).pipe(v)}function _(e,t,n){var r=this;if(r.joined(e))return Object(u.throwError)("had joined confr "+e+", if you want join again, please call exitConference");var o=r._events[e]=new r.EventsObservable(r,e,function(t){(function(e,t){}).call(r,e,t)});r.confrEventsObserver&&o.subscribe(r.confrEventsObserver);var s=r._service(e);return(s=r._services[e]=new emedia.XService({listeners:o})).setup(t,n),u.Observable.create(function(t){s.join(function(n){r.__current_confrId=e,r._confrs[e].joinId=n,r._confrs[e].role=s.current&&s.current.role,t.next(r._confrs[e]),t.complete()},function(e){s.exit(),t.error({errorType:"join_fail",error:-200,errorMessage:e.message()})})}).pipe(Object(d.concatMap)(function(t,n){return function(e,t,n){var r=this;return emedia.ctrl.support(n,function(t,n,i){r.onHasRemoteControl(t,n,i,e)},function(t,n,i){r.onRemoteFreeControl(t,n,i,e)}),p.info("support remote control. ",e,t),Object(u.of)(i.a.extend({},r._confrs[e]))}.call(r,e,t,s)}),Object(d.concatMap)(function(t,n){return function(e,t){var n=this,r=n._confr(e),o=n._service(e);switch(r.type){case 0:case 10:case 11:break;case 12:var s=new n.ZeroStream;if(o.current._cacheStreams[s.id]=s,o.current.role==R.Role.AUDIENCE)return T.call(n,e,s,!1,!0).pipe(Object(d.concatMap)(function(){return Object(u.of)(i.a.extend({},n._confrs[e]))}));break;case 13:case 14:default:return Object(u.throwError)("not support conf type: "+r.type)}return Object(u.of)(i.a.extend({},n._confrs[e]))}.call(r,e,t)}),v)}function y(e,t,n){var r=this;return g.call(r,e,t,n).pipe(Object(d.concatMap)(function(i,o){return function(e,t,n){var r=this;return b.call(r,e,t,n).pipe(Object(d.concatMap)(function(t,i){return _.call(r,e,t.ticket,n)}))}.call(r,e,t,n)}))}function S(e,t){var n=this._service(e);return u.Observable.create(function(e){n.openUserMedia(t).then(function(){e.next(t),e.complete()},function(t){e.error({errorType:"open_user_media_fail",error:-201,errorMessage:t.message()})})}).pipe(v)}function w(e,t){var n=this._service(e);return u.Observable.create(function(e){n.push(t,function(t){e.next(t),e.complete()},function(t){e.error({errorType:"push_fail",error:-203,errorMessage:t.message()})})}).pipe(v)}function x(e,t,n){var r=this._confr(n),i=this._service(n);return(e="string"==typeof e?i.getStreamById(e):i.getStreamById(e.id))?"boolean"!=typeof t&&e.constaints&&c.a.isEqual(t,e.constaints.video)||t==!e.voff?Object(u.of)(c.a.extend({},r.av)):function(e,t,n){var r=this._service(e);return u.Observable.create(function(e){r._republishByVideoConstaints(t,n,function(t){e.error({errorType:"voff_fail",error:-203,errorMessage:t.message()})},function(){e.next(r.getStreamById(t.id)),e.complete()})}).pipe(v)}.call(this,n,e,t):Object(u.throwError)("pub stream not exsits. it is "+e)}function C(e,t,n){var r=this._confr(n),i=this._service(n);return(e="string"==typeof e?i.getStreamById(e):i.getStreamById(e.id))?r.type!==this.ConfrType.COMMUNICATION_MIX&&r.type!==this.ConfrType.LIVE||1!==e.type||t?function(e,t,n){var r=this._service(e);return u.Observable.create(function(e){r.aoff(t,n,function(t){e.error({errorType:"aoff_fail",error:-203,errorMessage:t.message()})},function(){e.next(r.getStreamById(t.id)),e.complete()})}).pipe(v)}.call(this,n,e,t):(p.warn("confr mix. not allow desktop with audio."),Object(u.throwError)("confr mix. not allow desktop with audio.")):Object(u.throwError)("pub stream not exsits. it is "+e)}function E(e){var t=this._confr(e),n=this._service(e);return n.current.role==this.Role.AUDIENCE?Object(u.throwError)("Audience not allow publish"):u.Observable.create(function(e){n.chanageCamera(t.av,function(t){e.error({errorType:"switch_camera_fail",error:-203,errorMessage:t.message()})},function(){e.complete()})}).pipe(v)}function T(e,t,n,r,o){var s=this,a="string"==typeof t?t:t.id,c=s._confr(e),d=s._service(e);return 2===t.type&&1==r&&0!=t.id&&(r=!1,p.warn("Mixed audio stream. not allow repeat sub audio. force reset subSAudio = false")),o&&i.a.targetDOM(o)&&s.streamBindVideo(a,o),u.Observable.create(function(e){d.subscribe(a,function(t){try{if("0"!=a){var n=d.getStreamById(a),r={video:n.subArgs?n.subArgs.subSVideo:!n.voff,audio:n.subArgs?n.subArgs.subSAudio:!n.aoff};2===n.type&&(r.audio=!0),s._onMemberMediaChanaged(n.owner,n,r,c.confrId)}}finally{e.next(t),e.complete()}},function(t){e.error({errorType:"sub_fail",error:-203,errorMessage:t.message()})},{subSVideo:n,subSAudio:r})}).pipe(v)}var I=i.a.extend(new h,{_confr:function(e){return e||(e=this.__current_confrId),this._confrs[e]},_service:function(e){return e||(e=this.__current_confrId),this._services[e]},getStreamById:function(e,t){var n=this._service(t);return n&&n.getStreamById(e)},getMemberById:function(e,t){var n=this._service(t);return n&&n.getMemberById(e)},streamBindVideo:function(e,t,n){(function(e,t,n){var r=this,i=r._service(n);e=i.current._cacheStreams["string"==typeof e?e:e.id];var o=t||r.crtAndReturnVideo(e.owner,e);if(o){r._videos[e.id]=o,o.setAttribute("autoplay","autoplay"),o.setAttribute("playsinline","playsinline"),o.setAttribute("easemob_stream",e.id),e.aoff?o.setAttribute("aoff","aoff"):o.removeAttribute("aoff"),e.voff?o.setAttribute("voff","voff"):o.removeAttribute("voff"),e.ifMediaStream(function(e){o&&attachMediaStream(o,e),o.hasAttribute("flow")&&r.onMediaTransmission(o,function(e,t,n,r){s()(o).trigger("onMediaTransmission",[e,t,n,r])})});var a=s()(o);a.off("hungup"),a.on("hungup",function(t,i,o){r.hungup(e,n),o&&o()}),a.off("subscribe"),a.on("subscribe",function(t,i,o,s,a){e.located()?s&&s("local stream not allow sub"):(i=e.subArgs&&e.subArgs.subSVideo||!0,o=e.subArgs&&e.subArgs.subSAudio||!0,r.subscribe(e.owner,e,i,o,n).then(a).catch(s))}),a.off("pauseVideo"),a.on("pauseVideo",function(t,i,o){e.located()?r.pauseVideo(e,n).then(o).catch(i):r.subscribe(e.owner,e,!1,e.subArgs&&e.subArgs.subSAudio||!e.aoff,n).then(o).catch(i)}),a.off("resumeVideo"),a.on("resumeVideo",function(t,i,o){e.located()?r.resumeVideo(e,!0,n).then(o).catch(i):r.subscribe(e.owner,e,!0,e.subArgs&&e.subArgs.subSVideo||!e.voff,n).then(o).catch(i)}),a.off("pauseAudio"),a.on("pauseAudio",function(t,i,o){e.located()?r.pauseAudio(e,n).then(o).catch(i):r.subscribe(e.owner,e,e.subArgs.subSVideo,!1,n).then(o).catch(i)}),a.off("resumeAudio"),a.on("resumeAudio",function(t,i,o){e.located()?r.resumeAudio(e,n).then(o).catch(i):r.subscribe(e.owner,e,e.subArgs.subSVideo,!0,n).then(o).catch(i)}),a.off("remoteControl"),a.on("remoteControl",function(t,i,s,a,c,u,d,l){if(e.located())throw p.error("not allow remote control at local"),"not allow remote control at local";r.remoteControl(e,o,o,i,s,a,c,u,d,l,n)}),a.off("chanageCamera"),a.on("chanageCamera",function(e,t,i){r.chanageCamera(n).then(i).catch(t)}),a.off("captureVideo"),a.on("captureVideo",function(e,t,i,s){var a=r.captureVideo(o,i,s,n);t&&t(a)}),a.off("capturePictureRemote"),a.on("capturePictureRemote",function(t,i,o){r.capturePictureRemote(e,!1,n).then(o).catch(i)}),a.off("freezeFrameRemote"),a.on("freezeFrameRemote",function(t,i,o){r.freezeFrameRemote(e,n).then(o).catch(i)}),a.off("zoomRemote"),a.on("zoomRemote",function(t,i,o,s){r.zoomRemote(e,i,n).then(s).catch(o)}),a.off("torchRemote"),a.on("torchRemote",function(t,i,o,s){r.torchRemote(e,i,n).then(s).catch(o)}),a.off("freeRemoteControl"),a.on("freeRemoteControl",function(t,i,o){try{r.freeRemoteControl(e,n)}finally{o&&o()}});var c={video:!e.voff,audio:!e.aoff,voff:e.voff,aoff:e.aoff};e.located()||(c={video:e.subArgs?e.subArgs.subSVideo:!e.voff,audio:e.subArgs?e.subArgs.subSAudio:!e.aoff,voff:e.voff,aoff:e.aoff}),a.trigger("onMediaChanaged",[c,e,e.owner,n]),o.getAttribute("sound")&&(i.current._monitSoundChanagedStreams=i.current._monitSoundChanagedStreams||{},i.current._monitSoundChanagedStreams[e.id]=e.id)}}).call(this,e,t,n)},getBindVideoBy:function(e){if("string"!=typeof e&&e&&e.id&&(e=e.id),"string"!=typeof e)throw p.error("Bad stream ",e),"Bad stream "+e;return this._videos[e]},createConfr:function(e,t){return function(e,t){var n=this;return"string"==typeof e&&(e=parseInt(e)),u.Observable.create(h.prototype.createConfr.call(n,{uid:n.identityName,token:n.identityToken,confrType:e,password:t,terminal:n._terminalInfo})).pipe(Object(d.map)(function(e){return e.mixed=11===e.type||12===e.type,e.id=e.serverConfrId=e.confrId,n._confrs[e.confrId]=c.a.extend({},e),i.a.removeAttribute(e,"rtcCfg"),e}),v)}.apply(this,arguments).toPromise()},reqTkt:function(e,t){return b.apply(this,arguments).toPromise()},chanageRoles:function(e,t,n){return function(e,t,n){var r=this._confr(n),i=this._service(n),o={uids:t,role:e,roleToken:r.roleToken};return u.Observable.create(h.prototype.chanageRoles.call(this,o)).pipe(Object(d.map)(function(e){return i&&i.current&&i.current._sysCopy(),r.id}),v)}.apply(this,arguments).toPromise()},disbandConfr:function(e,t){return function(e,t){var n=this,r=n._confr(e),o={roleToken:r&&r.roleToken||t};return u.Observable.create(h.prototype.disbandConfr.call(n,o)).pipe(Object(d.map)(function(t){return i.a.removeAttribute(n._confrs,e),r.id}),v)}.apply(this,arguments).toPromise()},kickMember:function(e,t){return function(e,t){var n=this._confr(t),r={uids:e,roleToken:n.roleToken};return u.Observable.create(h.prototype.kickMember.call(this,r)).pipe(Object(d.map)(function(e){return n.id}),v)}.apply(this,arguments).toPromise()},selectConfr:function(e,t){return g.apply(this,arguments).toPromise()},joinUsePassword:function(e,t,n){return y.call(this,e,t,n).toPromise()},joinUseTicket:function(e,t,n){return _.call(this,e,t,n).toPromise()},joined:function(e){return e&&this._confrs[e]&&this._confrs[e].joinId||this.__current_confrId&&this.joined(this.__current_confrId)},shareDesktopWithAudio:function(e,t,n,r,o){return i.a.targetDOM(n)||(o=r,r=n,n=void 0),function(e,t,n,r){var o=this,s=o._confr(e),a=o._service(e);if(a.current.role==o.Role.AUDIENCE)return Object(u.throwError)("Audience not allow publish");if(s.desktop)return Object(u.throwError)("desktop stream has been published. not allow repeat publish.");if((s.type===o.ConfrType.COMMUNICATION_MIX||s.type===o.ConfrType.LIVE)&&t.audio)return p.warn("confr mix. not allow desktop with audio."),Object(u.throwError)("confr mix. not allow desktop with audio.");t.audio||!s.av||s.av.aoff||p.warn("repeat audio. desktop and av");var c=s.desktop=new a.ShareDesktopPubstream({screenOptions:t.video&&t.video.screenOptions||["screen","window","tab"],mandatory:t.video&&t.video.mandatory||{},vbitrate:t.video&&t.video.bitrate,abitrate:t.audio&&t.audio.bitrate,aoff:t.audio?0:1,ext:r});return S.call(o,s.id,c).pipe(Object(d.concatMap)(function(e){return n&&i.a.targetDOM(n)&&attachMediaStream(n,e.localStream),w.call(o,s.id,e,r)}),Object(d.map)(function(e){return s.desktop=e,n&&i.a.targetDOM(n)&&o.streamBindVideo(s.desktop,n),i.a.extend({},e)}),Object(d.catchError)(function(e,t){throw s.desktop=void 0,p.error(e),e}))}.call(this,o,{video:e,audio:t},n,r).toPromise()},chanageCamera:function(e){return E.call(this,e).toPromise()},switchCamera:function(e){return E.call(this,e).toPromise()},shareVideoWithAudio:function(e,t,n,r,o){return i.a.targetDOM(n)||(o=r,r=n,n=void 0),function(e,t,n,r){var o=this,s=o._confr(e),a=o._service(e);if(a.current.role==o.Role.AUDIENCE)return Object(u.throwError)("Audience not allow publish");if(s.av)return Object(u.throwError)("Audio and video stream has been published. not allow repeat publish.");var c=s.mixed?a.AudioMixerPubstream:a.AVPubstream,l=s.av=new c({constaints:t,aoff:0,voff:0,ext:r});return S.call(o,s.id,l).pipe(Object(d.concatMap)(function(e){return n&&i.a.targetDOM(n)&&attachMediaStream(n,e.localStream),w.call(o,s.id,e,r)}),Object(d.map)(function(e){return s.av=e,n&&o.streamBindVideo(s.av,n),s.type==o.ConfrType.LIVE&&o.hungup(0),i.a.extend({},e)}),Object(d.catchError)(function(e,t){throw s.av&&o.hungup(s.av),s.av=void 0,p.error(e),e}))}.call(this,o,{video:e,audio:t},n,r).toPromise()},captureVideo:function(e,t,n,r){return this._service(r).captureVideo(e,t,n)},openUserMedia:function(e,t){var n=this._service(t);return u.Observable.create(function(t){n.__getUserMedia(e,function(e,n){t.next(n),t.complete()},function(e){t.error(e)})}).pipe(v).toPromise()},mediaDevices:function(e){return"function"==typeof e&&(e=void 0),u.Observable.create(function(t){navigator.mediaDevices.enumerateDevices().then(function(n){for(var r=[],i=0;i!==n.length;++i){var o=n[i];o.deviceId;e||r.push(o),e&&e===o.kind?r.push(o):"audioinput"===o.kind||"audiooutput"===o.kind||"videoinput"===o.kind||p.info("Some other kind of source/device: ",o)}t.next(r),t.complete()}).catch(function(e){p.warn("navigator.getUserMedia error: ",e),t.error(e)})}).pipe(v).toPromise()},resumeVideo:function(e,t,n){return x.call(this,e,t||!0,n).toPromise()},pauseVideo:function(e,t){return x.call(this,e,!1,t).toPromise()},resumeAudio:function(e,t){return C.call(this,e,!1,t).toPromise()},pauseAudio:function(e,t){return C.call(this,e,!0,t).toPromise()},freezeFrameRemote:function(e,t){return function(e,t){"string"!=typeof t&&(t=t.id),this._confr(e);var n=this._service(e);return u.Observable.create(function(e){n.freezeFrameRemote(t,function(t){e.next(t),e.complete()},function(t){e.error({errorType:"freeze_remote_fail",error:-203,errorMessage:t.message()})})}).pipe(v)}.call(this,t,e).toPromise()},torchRemote:function(e,t,n){return function(e,t,n){"string"!=typeof t&&(t=t.id),this._confr(e);var r=this._service(e);return u.Observable.create(function(e){r.torchRemote(t,n,function(t){e.next(t),e.complete()},function(t){e.error({errorType:"torch_remote_fail",error:-203,errorMessage:t.message()})})}).pipe(v)}.call(this,n,e,t).toPromise()},zoomRemote:function(e,t,n){return function(e,t,n){"string"!=typeof t&&(t=t.id),this._confr(e);var r=this._service(e);return u.Observable.create(function(e){r.zoomRemote(t,n,function(t){e.error({errorType:"capture_remote_fail",error:-203,errorMessage:t.message()})},function(){e.complete()})}).pipe(v)}.call(this,n,e,t).toPromise()},capturePictureRemote:function(e,t){return function(e,t,n){"string"!=typeof t&&(t=t.id),this._confr(e);var r=this._service(e);return u.Observable.create(function(e){r.capturePictureRemote(t,n,function(t){e.next(t),e.complete()},function(t){e.error({errorType:"capture_remote_fail",error:-203,errorMessage:t.message()})})}).pipe(v)}.call(this,t,e,!1).toPromise()},focusExpoRemote:function(e,t,n,r){return function(e,t,n,r){"string"!=typeof t&&(t=t.id),this._confr(e);var i=this._service(e);return u.Observable.create(function(e){i.focusExpoRemote(t,n,r,function(t){e.error({errorType:"focusexpo_remote_fail",error:-203,errorMessage:t.message()})},function(){e.complete()})}).pipe(v)}.call(this,r,e,t,n).toPromise()},onFocusExpoRemoteWhenClickVideo:function(e,t,n,r){var i=this;return"function"==typeof t&&(r=n,n=t,t=void 0),s()(e).off(t||"click"),s()(e).on(t||"click",function(t){var o=e.getAttribute("easemob_stream");i.focusExpoRemote(o,e,t).then(r).catch(n)}),t},offEventAtTag:function(e,t){t&&s()(e).off(t)},hungup:function(e,t){var n;n="string"==typeof e?e:e.id||e+"";var r=this._service(t),i=this._confr(t);if(i&&r){r.hungup(n);var o=!1;if(i.av&&(o=i.av.id===n)&&(i.av=void 0),i.desktop&&i.desktop.id===n&&(i.desktop=void 0),o&&i.type==this.ConfrType.LIVE&&r.current.role==R.Role.AUDIENCE){var s=r.current&&r.current._cacheStreams[0];this.subscribe(r.current,s,!1,!0,t)}}else p.warn("when hungup stream. not found confr and service.",e)},subscribe:function(e,t,n,r,o,s){return i.a.targetDOM(o)||(s=o,o=void 0),T.call(this,s,t,n,r,o).toPromise()},exit:function(e,t){var n=this._service(t);n?n.exit(e):p.warn("when exit. not found service.",t)},_onExit:function(e,t,n){try{this.__current_confrId=void 0,this.onExit(t,n,e)}finally{i.a.removeAttribute(this._confrs,e),i.a.removeAttribute(this._services,e),i.a.removeAttribute(this._videos,e),i.a.removeAttribute(this._events,e)}},onExit:function(e,t,n){},_onRoleUpdated:function(e,t){},onMemberJoin:function(e,t){},onMemberLeave:function(e,t,n){},_onRecvRemoteMessage:function(e,t,n){},crtAndReturnVideo:function(e,t,n){},unloadVideo:function(e,t,n,r){},remoteControl:function(e,t,n,r,i,o,s,a,c,u,d){var l=this._service(d);r=!!r;var f="string"==typeof e?e:e.id;r?emedia.ctrl.mirrorControlled(l,f,t,n,i,o,s,a,c,u):emedia.ctrl.controlled(l,f,t,n,i,o,s,a,c,u)},freeRemoteControl:function(e,t){var n=this._service(t),r="string"==typeof e?e:e.id;emedia.ctrl.disControlled(n,r)},zeptoTrigger:function(e,t){return u.Observable.create(function(n){s()(e).trigger(t,[function(){n.error.apply(n,arguments)},function(){n.next.apply(n,arguments),n.complete()}])}).pipe(v).toPromise()},_onAddMemberStream:function(e,t){},_onRemoveMemberStream:function(e,t){},_onUpdateMemberStream:function(e,t,n){},_onMemberMediaChanaged:function(e,t,n,r){var i=this._videos[t.id];n&&(n.voff=t.voff,n.aoff=t.aoff),i&&s()(i).trigger("onMediaChanaged",[n,t,e,r])},onMediaChanaged:function(e,t){this.addVideoEventListener(e,"onMediaChanaged",t)},_onMemberSoundChanaged:function(e,t,n,r){var i=this._videos[t.id];i&&s()(i).trigger("onSoundChanaged",[n,t,e,r])},onSoundChanaged:function(e,t){if(!emedia.config.getMediaMeterIntervalMillis||emedia.config.getMediaMeterIntervalMillis<=0)throw p.error("monit sound chanaged not config. please config getMediaMeterIntervalMillis"),"monit sound chanaged not config. please config getMediaMeterIntervalMillis";e.setAttribute("sound","sound"),this.addVideoEventListener(e,"onSoundChanaged",t)},onMediaTransmission:function(e,t){if(emedia.helper&&"function"==typeof emedia.helper.inboundVideo){var n=this._service(),r=e.getAttribute("easemob_stream"),i=r&&n.getStreamById(r),o=e.getAttribute("flowWebrtc");i&&i._webrtc&&o==i._webrtc.__id||(e.hasAttribute("flow")&&i&&i._webrtc?(i.located()?emedia.helper.outboundVideo(i,t,1e3):emedia.helper.inboundVideo(i,t,1e3),e.setAttribute("flowWebrtc",i._webrtc.__id)):(this.addVideoEventListener(e,"onMediaTransmission",t),e.setAttribute("flow","flow")))}else p.warn("please import helper. <script>")},_onTalking:function(e,t,n,r){},_onNotSupportMemberPublishVideoCodecs:function(e,t,n){var r=this._videos[t.id];r&&s()(r).trigger("onNotSupportVideoCodecs",[t,e,n])},onNotSupportVideoCodecs:function(e,t){this.addVideoEventListener(e,"onNotSupportVideoCodecs",t)},_onStreamIceStateChanged:function(e,t,n,r){var i=this._videos[t.id];i&&s()(i).trigger("onIceStateChanged",[n,t,e,r])},onIceStateChanged:function(e,t){this.addVideoEventListener(e,"onIceStateChanged",t)},onHasRemoteControl:function(e,t,n,r){var i=this._videos[e.id];i&&s()(i).trigger("onRemoteControl",[t,n,e,r])},onRemoteControl:function(e,t){this.addVideoEventListener(e,"onRemoteControl",t)},onRemoteFreeControl:function(e,t,n,r){var i=this._videos[e.id];i&&s()(i).trigger("onFreeControl",[t,n,e,r])},onFreeControl:function(e,t){this.addVideoEventListener(e,"onFreeControl",t)},addVideoEventListener:function(e,t,n){s()(e).off(t),s()(e).on(t,function(){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);n&&n.apply(e,t)})}});c.a.each(["hungup","subscribe","pauseVideo","resumeVideo","pauseAudio","resumeAudio","chanageCamera","freeRemoteControl","capturePictureRemote","freezeFrameRemote"],function(e,t){var n=e.replace(/\b[a-z]/g,function(e){return e.toUpperCase()});I["trigger"+n]=function(t){return I.zeptoTrigger(t,e)}}),I.triggerTorchRemote=function(e,t){return u.Observable.create(function(n){s()(e).trigger("torchRemote",[t,function(){n.error.apply(n,arguments)},function(){n.next.apply(n,arguments),n.complete()}])}).pipe(v).toPromise()},I.triggerZoomRemote=function(e,t){return u.Observable.create(function(n){s()(e).trigger("zoomRemote",[t,function(){n.error.apply(n,arguments)},function(){n.next.apply(n,arguments),n.complete()}])}).pipe(v).toPromise()},I.triggerSubscribe=function(e,t,n){return u.Observable.create(function(r){s()(e).trigger("subscribe",[t,n,function(){r.error.apply(r,arguments)},function(){r.next.apply(r,arguments),r.complete()}])}).pipe(v).toPromise()},I.triggerRemoteControl=function(e,t,n,r,i,o,a,c){s()(e).trigger("remoteControl",[t,n,r,i,o,a,c])},I.triggerCaptureVideo=function(e,t,n){return u.Observable.create(function(r){s()(e).trigger("captureVideo",[function(){r.next.apply(r,arguments),r.complete()},t,n])}).pipe(v).toPromise()};var R=I},function(e,t,n){"use strict";n.r(t);var r=n(37);n.d(t,"Observable",function(){return r.Observable});var i=n(55);n.d(t,"ConnectableObservable",function(){return i.ConnectableObservable});var o=n(60);n.d(t,"GroupedObservable",function(){return o.GroupedObservable});var s=n(52);n.d(t,"observable",function(){return s.observable});var a=n(56);n.d(t,"Subject",function(){return a.Subject});var c=n(61);n.d(t,"BehaviorSubject",function(){return c.BehaviorSubject});var u=n(62);n.d(t,"ReplaySubject",function(){return u.ReplaySubject});var d=n(79);n.d(t,"AsyncSubject",function(){return d.AsyncSubject});var l=n(80);n.d(t,"asapScheduler",function(){return l.asap});var f=n(84);n.d(t,"asyncScheduler",function(){return f.async});var p=n(63);n.d(t,"queueScheduler",function(){return p.queue});var h=n(85);n.d(t,"animationFrameScheduler",function(){return h.animationFrame});var m=n(88);n.d(t,"VirtualTimeScheduler",function(){return m.VirtualTimeScheduler}),n.d(t,"VirtualAction",function(){return m.VirtualAction});var v=n(69);n.d(t,"Scheduler",function(){return v.Scheduler});var b=n(45);n.d(t,"Subscription",function(){return b.Subscription});var g=n(39);n.d(t,"Subscriber",function(){return g.Subscriber});var _=n(71);n.d(t,"Notification",function(){return _.Notification});var y=n(53);n.d(t,"pipe",function(){return y.pipe});var S=n(54);n.d(t,"noop",function(){return S.noop});var w=n(89);n.d(t,"identity",function(){return w.identity});var x=n(90);n.d(t,"isObservable",function(){return x.isObservable});var C=n(91);n.d(t,"ArgumentOutOfRangeError",function(){return C.ArgumentOutOfRangeError});var E=n(92);n.d(t,"EmptyError",function(){return E.EmptyError});var T=n(57);n.d(t,"ObjectUnsubscribedError",function(){return T.ObjectUnsubscribedError});var I=n(50);n.d(t,"UnsubscriptionError",function(){return I.UnsubscriptionError});var R=n(93);n.d(t,"TimeoutError",function(){return R.TimeoutError});var k=n(94);n.d(t,"bindCallback",function(){return k.bindCallback});var O=n(96);n.d(t,"bindNodeCallback",function(){return O.bindNodeCallback});var M=n(97);n.d(t,"combineLatest",function(){return M.combineLatest});var A=n(108);n.d(t,"concat",function(){return A.concat});var P=n(118);n.d(t,"defer",function(){return P.defer});var j=n(72);n.d(t,"empty",function(){return j.empty});var N=n(119);n.d(t,"forkJoin",function(){return N.forkJoin});var D=n(109);n.d(t,"from",function(){return D.from});var L=n(120);n.d(t,"fromEvent",function(){return L.fromEvent});var V=n(121);n.d(t,"fromEventPattern",function(){return V.fromEventPattern});var F=n(122);n.d(t,"generate",function(){return F.generate});var U=n(123);n.d(t,"iif",function(){return U.iif});var W=n(124);n.d(t,"interval",function(){return W.interval});var B=n(126);n.d(t,"merge",function(){return B.merge});var z=n(127);n.d(t,"never",function(){return z.never});var $=n(73);n.d(t,"of",function(){return $.of});var q=n(128);n.d(t,"onErrorResumeNext",function(){return q.onErrorResumeNext});var G=n(129);n.d(t,"pairs",function(){return G.pairs});var H=n(130);n.d(t,"race",function(){return H.race});var Y=n(131);n.d(t,"range",function(){return Y.range});var J=n(78);n.d(t,"throwError",function(){return J.throwError});var K=n(132);n.d(t,"timer",function(){return K.timer});var X=n(133);n.d(t,"using",function(){return X.using});var Z=n(134);n.d(t,"zip",function(){return Z.zip}),n.d(t,"EMPTY",function(){return j.EMPTY}),n.d(t,"NEVER",function(){return z.NEVER});var Q=n(43);n.d(t,"config",function(){return Q.config})},function(e,t,n){"use strict";n.r(t),n.d(t,"Observable",function(){return a});var r=n(38),i=n(52),o=n(53),s=n(43),a=function(){function e(e){this._isScalar=!1,e&&(this._subscribe=e)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(e,t,n){var i=this.operator,o=Object(r.toSubscriber)(e,t,n);if(i?i.call(o,this.source):o.add(this.source||s.config.useDeprecatedSynchronousErrorHandling&&!o.syncErrorThrowable?this._subscribe(o):this._trySubscribe(o)),s.config.useDeprecatedSynchronousErrorHandling&&o.syncErrorThrowable&&(o.syncErrorThrowable=!1,o.syncErrorThrown))throw o.syncErrorValue;return o},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){s.config.useDeprecatedSynchronousErrorHandling&&(e.syncErrorThrown=!0,e.syncErrorValue=t),e.error(t)}},e.prototype.forEach=function(e,t){var n=this;return new(t=c(t))(function(t,r){var i;i=n.subscribe(function(t){try{e(t)}catch(n){r(n),i&&i.unsubscribe()}},r,t)})},e.prototype._subscribe=function(e){var t=this.source;return t&&t.subscribe(e)},e.prototype[i.observable]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 0===e.length?this:Object(o.pipeFromArray)(e)(this)},e.prototype.toPromise=function(e){var t=this;return new(e=c(e))(function(e,n){var r;t.subscribe(function(e){return r=e},function(e){return n(e)},function(){return e(r)})})},e.create=function(t){return new e(t)},e}();function c(e){if(e||(e=s.config.Promise||Promise),!e)throw new Error("no Promise impl found");return e}},function(e,t,n){"use strict";n.r(t),n.d(t,"toSubscriber",function(){return s});var r=n(39),i=n(51),o=n(42);function s(e,t,n){if(e){if(e instanceof r.Subscriber)return e;if(e[i.rxSubscriber])return e[i.rxSubscriber]()}return e||t||n?new r.Subscriber(e,t,n):new r.Subscriber(o.empty)}},function(e,t,n){"use strict";n.r(t),n.d(t,"Subscriber",function(){return d});var r=n(40),i=n(41),o=n(42),s=n(45),a=n(51),c=n(43),u=n(44),d=function(e){function t(t,n,r){var i=e.call(this)||this;switch(i.syncErrorValue=null,i.syncErrorThrown=!1,i.syncErrorThrowable=!1,i.isStopped=!1,arguments.length){case 0:i.destination=o.empty;break;case 1:if(!t){i.destination=o.empty;break}if("object"==typeof t){if(f(t)){var s=t[a.rxSubscriber]();i.syncErrorThrowable=s.syncErrorThrowable,i.destination=s,s.add(i)}else i.syncErrorThrowable=!0,i.destination=new l(i,t);break}default:i.syncErrorThrowable=!0,i.destination=new l(i,t,n,r)}return i}return r.__extends(t,e),t.prototype[a.rxSubscriber]=function(){return this},t.create=function(e,n,r){var i=new t(e,n,r);return i.syncErrorThrowable=!1,i},t.prototype.next=function(e){this.isStopped||this._next(e)},t.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this))},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){this.destination.error(e),this.unsubscribe()},t.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},t.prototype._unsubscribeAndRecycle=function(){var e=this._parent,t=this._parents;return this._parent=null,this._parents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parent=e,this._parents=t,this},t}(s.Subscription),l=function(e){function t(t,n,r,s){var a,c=e.call(this)||this;c._parentSubscriber=t;var u=c;return Object(i.isFunction)(n)?a=n:n&&(a=n.next,r=n.error,s=n.complete,n!==o.empty&&(u=Object.create(n),Object(i.isFunction)(u.unsubscribe)&&c.add(u.unsubscribe.bind(u)),u.unsubscribe=c.unsubscribe.bind(c))),c._context=u,c._next=a,c._error=r,c._complete=s,c}return r.__extends(t,e),t.prototype.next=function(e){if(!this.isStopped&&this._next){var t=this._parentSubscriber;c.config.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?this.__tryOrSetError(t,this._next,e)&&this.unsubscribe():this.__tryOrUnsub(this._next,e)}},t.prototype.error=function(e){if(!this.isStopped){var t=this._parentSubscriber,n=c.config.useDeprecatedSynchronousErrorHandling;if(this._error)n&&t.syncErrorThrowable?(this.__tryOrSetError(t,this._error,e),this.unsubscribe()):(this.__tryOrUnsub(this._error,e),this.unsubscribe());else if(t.syncErrorThrowable)n?(t.syncErrorValue=e,t.syncErrorThrown=!0):Object(u.hostReportError)(e),this.unsubscribe();else{if(this.unsubscribe(),n)throw e;Object(u.hostReportError)(e)}}},t.prototype.complete=function(){var e=this;if(!this.isStopped){var t=this._parentSubscriber;if(this._complete){var n=function(){return e._complete.call(e._context)};c.config.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?(this.__tryOrSetError(t,n),this.unsubscribe()):(this.__tryOrUnsub(n),this.unsubscribe())}else this.unsubscribe()}},t.prototype.__tryOrUnsub=function(e,t){try{e.call(this._context,t)}catch(n){if(this.unsubscribe(),c.config.useDeprecatedSynchronousErrorHandling)throw n;Object(u.hostReportError)(n)}},t.prototype.__tryOrSetError=function(e,t,n){if(!c.config.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{t.call(this._context,n)}catch(r){return c.config.useDeprecatedSynchronousErrorHandling?(e.syncErrorValue=r,e.syncErrorThrown=!0,!0):(Object(u.hostReportError)(r),!0)}return!1},t.prototype._unsubscribe=function(){var e=this._parentSubscriber;this._context=null,this._parentSubscriber=null,e.unsubscribe()},t}(d);function f(e){return e instanceof d||"syncErrorThrowable"in e&&e[a.rxSubscriber]}},function(e,t,n){"use strict";n.r(t),n.d(t,"__extends",function(){return i}),n.d(t,"__assign",function(){return o}),n.d(t,"__rest",function(){return s}),n.d(t,"__decorate",function(){return a}),n.d(t,"__param",function(){return c}),n.d(t,"__metadata",function(){return u}),n.d(t,"__awaiter",function(){return d}),n.d(t,"__generator",function(){return l}),n.d(t,"__exportStar",function(){return f}),n.d(t,"__values",function(){return p}),n.d(t,"__read",function(){return h}),n.d(t,"__spread",function(){return m}),n.d(t,"__await",function(){return v}),n.d(t,"__asyncGenerator",function(){return b}),n.d(t,"__asyncDelegator",function(){return g}),n.d(t,"__asyncValues",function(){return _}),n.d(t,"__makeTemplateObject",function(){return y}),n.d(t,"__importStar",function(){return S}),n.d(t,"__importDefault",function(){return w});var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function i(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var o=function(){return(o=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function s(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&(n[r[i]]=e[r[i]])}return n}function a(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s}function c(e,t){return function(n,r){t(n,r,e)}}function u(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function d(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{c(r.next(e))}catch(t){o(t)}}function a(e){try{c(r.throw(e))}catch(t){o(t)}}function c(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(s,a)}c((r=r.apply(e,t||[])).next())})}function l(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(a){o=[6,a],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}function f(e,t){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}function p(e){var t="function"==typeof Symbol&&e[Symbol.iterator],n=0;return t?t.call(e):{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}function h(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(a){i={error:a}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}function m(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(h(arguments[t]));return e}function v(e){return this instanceof v?(this.v=e,this):new v(e)}function b(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(e,t||[]),o=[];return r={},s("next"),s("throw"),s("return"),r[Symbol.asyncIterator]=function(){return this},r;function s(e){i[e]&&(r[e]=function(t){return new Promise(function(n,r){o.push([e,t,n,r])>1||a(e,t)})})}function a(e,t){try{(n=i[e](t)).value instanceof v?Promise.resolve(n.value.v).then(c,u):d(o[0][2],n)}catch(r){d(o[0][3],r)}var n}function c(e){a("next",e)}function u(e){a("throw",e)}function d(e,t){e(t),o.shift(),o.length&&a(o[0][0],o[0][1])}}function g(e){var t,n;return t={},r("next"),r("throw",function(e){throw e}),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,i){t[r]=e[r]?function(t){return(n=!n)?{value:v(e[r](t)),done:"return"===r}:i?i(t):t}:i}}function _(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=p(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise(function(r,i){(function(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)})(r,i,(t=e[n](t)).done,t.value)})}}}function y(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function S(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function w(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){"use strict";function r(e){return"function"==typeof e}n.r(t),n.d(t,"isFunction",function(){return r})},function(e,t,n){"use strict";n.r(t),n.d(t,"empty",function(){return o});var r=n(43),i=n(44),o={closed:!0,next:function(e){},error:function(e){if(r.config.useDeprecatedSynchronousErrorHandling)throw e;Object(i.hostReportError)(e)},complete:function(){}}},function(e,t,n){"use strict";n.r(t),n.d(t,"config",function(){return i});var r=!1,i={Promise:void 0,set useDeprecatedSynchronousErrorHandling(e){e&&(new Error).stack;r=e},get useDeprecatedSynchronousErrorHandling(){return r}}},function(e,t,n){"use strict";function r(e){setTimeout(function(){throw e})}n.r(t),n.d(t,"hostReportError",function(){return r})},function(e,t,n){"use strict";n.r(t),n.d(t,"Subscription",function(){return u});var r=n(46),i=n(47),o=n(41),s=n(48),a=n(49),c=n(50),u=function(){function e(e){this.closed=!1,this._parent=null,this._parents=null,this._subscriptions=null,e&&(this._unsubscribe=e)}var t;return e.prototype.unsubscribe=function(){var e,t=!1;if(!this.closed){var n=this._parent,u=this._parents,l=this._unsubscribe,f=this._subscriptions;this.closed=!0,this._parent=null,this._parents=null,this._subscriptions=null;for(var p=-1,h=u?u.length:0;n;)n.remove(this),n=++p<h&&u[p]||null;if(Object(o.isFunction)(l))Object(s.tryCatch)(l).call(this)===a.errorObject&&(t=!0,e=e||(a.errorObject.e instanceof c.UnsubscriptionError?d(a.errorObject.e.errors):[a.errorObject.e]));if(Object(r.isArray)(f))for(p=-1,h=f.length;++p<h;){var m=f[p];if(Object(i.isObject)(m))if(Object(s.tryCatch)(m.unsubscribe).call(m)===a.errorObject){t=!0,e=e||[];var v=a.errorObject.e;v instanceof c.UnsubscriptionError?e=e.concat(d(v.errors)):e.push(v)}}if(t)throw new c.UnsubscriptionError(e)}},e.prototype.add=function(t){if(!t||t===e.EMPTY)return e.EMPTY;if(t===this)return this;var n=t;switch(typeof t){case"function":n=new e(t);case"object":if(n.closed||"function"!=typeof n.unsubscribe)return n;if(this.closed)return n.unsubscribe(),n;if("function"!=typeof n._addParent){var r=n;(n=new e)._subscriptions=[r]}break;default:throw new Error("unrecognized teardown "+t+" added to Subscription.")}return(this._subscriptions||(this._subscriptions=[])).push(n),n._addParent(this),n},e.prototype.remove=function(e){var t=this._subscriptions;if(t){var n=t.indexOf(e);-1!==n&&t.splice(n,1)}},e.prototype._addParent=function(e){var t=this._parent,n=this._parents;t&&t!==e?n?-1===n.indexOf(e)&&n.push(e):this._parents=[e]:this._parent=e},e.EMPTY=((t=new e).closed=!0,t),e}();function d(e){return e.reduce(function(e,t){return e.concat(t instanceof c.UnsubscriptionError?t.errors:t)},[])}},function(e,t,n){"use strict";n.r(t),n.d(t,"isArray",function(){return r});var r=Array.isArray||function(e){return e&&"number"==typeof e.length}},function(e,t,n){"use strict";function r(e){return null!=e&&"object"==typeof e}n.r(t),n.d(t,"isObject",function(){return r})},function(e,t,n){"use strict";n.r(t),n.d(t,"tryCatch",function(){return s});var r,i=n(49);function o(){try{return r.apply(this,arguments)}catch(e){return i.errorObject.e=e,i.errorObject}}function s(e){return r=e,o}},function(e,t,n){"use strict";n.r(t),n.d(t,"errorObject",function(){return r});var r={e:{}}},function(e,t,n){"use strict";n.r(t),n.d(t,"UnsubscriptionError",function(){return i});var r=n(40),i=function(e){function t(n){var r=e.call(this,n?n.length+" errors occurred during unsubscription:\n  "+n.map(function(e,t){return t+1+") "+e.toString()}).join("\n  "):"")||this;return r.errors=n,r.name="UnsubscriptionError",Object.setPrototypeOf(r,t.prototype),r}return r.__extends(t,e),t}(Error)},function(e,t,n){"use strict";n.r(t),n.d(t,"rxSubscriber",function(){return r}),n.d(t,"$$rxSubscriber",function(){return i});var r="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("rxSubscriber"):"@@rxSubscriber",i=r},function(e,t,n){"use strict";n.r(t),n.d(t,"observable",function(){return r});var r="function"==typeof Symbol&&Symbol.observable||"@@observable"},function(e,t,n){"use strict";n.r(t),n.d(t,"pipe",function(){return i}),n.d(t,"pipeFromArray",function(){return o});var r=n(54);function i(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o(e)}function o(e){return e?1===e.length?e[0]:function(t){return e.reduce(function(e,t){return t(e)},t)}:r.noop}},function(e,t,n){"use strict";function r(){}n.r(t),n.d(t,"noop",function(){return r})},function(e,t,n){"use strict";n.r(t),n.d(t,"ConnectableObservable",function(){return u}),n.d(t,"connectableObservableDescriptor",function(){return l});var r=n(40),i=n(56),o=n(37),s=n(39),a=n(45),c=n(59),u=function(e){function t(t,n){var r=e.call(this)||this;return r.source=t,r.subjectFactory=n,r._refCount=0,r._isComplete=!1,r}return r.__extends(t,e),t.prototype._subscribe=function(e){return this.getSubject().subscribe(e)},t.prototype.getSubject=function(){var e=this._subject;return e&&!e.isStopped||(this._subject=this.subjectFactory()),this._subject},t.prototype.connect=function(){var e=this._connection;return e||(this._isComplete=!1,(e=this._connection=new a.Subscription).add(this.source.subscribe(new f(this.getSubject(),this))),e.closed?(this._connection=null,e=a.Subscription.EMPTY):this._connection=e),e},t.prototype.refCount=function(){return Object(c.refCount)()(this)},t}(o.Observable),d=u.prototype,l={operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:d._subscribe},_isComplete:{value:d._isComplete,writable:!0},getSubject:{value:d.getSubject},connect:{value:d.connect},refCount:{value:d.refCount}},f=function(e){function t(t,n){var r=e.call(this,t)||this;return r.connectable=n,r}return r.__extends(t,e),t.prototype._error=function(t){this._unsubscribe(),e.prototype._error.call(this,t)},t.prototype._complete=function(){this.connectable._isComplete=!0,this._unsubscribe(),e.prototype._complete.call(this)},t.prototype._unsubscribe=function(){var e=this.connectable;if(e){this.connectable=null;var t=e._connection;e._refCount=0,e._subject=null,e._connection=null,t&&t.unsubscribe()}},t}(i.SubjectSubscriber);s.Subscriber},function(e,t,n){"use strict";n.r(t),n.d(t,"SubjectSubscriber",function(){return d}),n.d(t,"Subject",function(){return l}),n.d(t,"AnonymousSubject",function(){return f});var r=n(40),i=n(37),o=n(39),s=n(45),a=n(57),c=n(58),u=n(51),d=function(e){function t(t){var n=e.call(this,t)||this;return n.destination=t,n}return r.__extends(t,e),t}(o.Subscriber),l=function(e){function t(){var t=e.call(this)||this;return t.observers=[],t.closed=!1,t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return r.__extends(t,e),t.prototype[u.rxSubscriber]=function(){return new d(this)},t.prototype.lift=function(e){var t=new f(this,this);return t.operator=e,t},t.prototype.next=function(e){if(this.closed)throw new a.ObjectUnsubscribedError;if(!this.isStopped)for(var t=this.observers,n=t.length,r=t.slice(),i=0;i<n;i++)r[i].next(e)},t.prototype.error=function(e){if(this.closed)throw new a.ObjectUnsubscribedError;this.hasError=!0,this.thrownError=e,this.isStopped=!0;for(var t=this.observers,n=t.length,r=t.slice(),i=0;i<n;i++)r[i].error(e);this.observers.length=0},t.prototype.complete=function(){if(this.closed)throw new a.ObjectUnsubscribedError;this.isStopped=!0;for(var e=this.observers,t=e.length,n=e.slice(),r=0;r<t;r++)n[r].complete();this.observers.length=0},t.prototype.unsubscribe=function(){this.isStopped=!0,this.closed=!0,this.observers=null},t.prototype._trySubscribe=function(t){if(this.closed)throw new a.ObjectUnsubscribedError;return e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){if(this.closed)throw new a.ObjectUnsubscribedError;return this.hasError?(e.error(this.thrownError),s.Subscription.EMPTY):this.isStopped?(e.complete(),s.Subscription.EMPTY):(this.observers.push(e),new c.SubjectSubscription(this,e))},t.prototype.asObservable=function(){var e=new i.Observable;return e.source=this,e},t.create=function(e,t){return new f(e,t)},t}(i.Observable),f=function(e){function t(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r}return r.__extends(t,e),t.prototype.next=function(e){var t=this.destination;t&&t.next&&t.next(e)},t.prototype.error=function(e){var t=this.destination;t&&t.error&&this.destination.error(e)},t.prototype.complete=function(){var e=this.destination;e&&e.complete&&this.destination.complete()},t.prototype._subscribe=function(e){return this.source?this.source.subscribe(e):s.Subscription.EMPTY},t}(l)},function(e,t,n){"use strict";n.r(t),n.d(t,"ObjectUnsubscribedError",function(){return i});var r=n(40),i=function(e){function t(){var n=e.call(this,"object unsubscribed")||this;return n.name="ObjectUnsubscribedError",Object.setPrototypeOf(n,t.prototype),n}return r.__extends(t,e),t}(Error)},function(e,t,n){"use strict";n.r(t),n.d(t,"SubjectSubscription",function(){return i});var r=n(40),i=function(e){function t(t,n){var r=e.call(this)||this;return r.subject=t,r.subscriber=n,r.closed=!1,r}return r.__extends(t,e),t.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var e=this.subject,t=e.observers;if(this.subject=null,t&&0!==t.length&&!e.isStopped&&!e.closed){var n=t.indexOf(this.subscriber);-1!==n&&t.splice(n,1)}}},t}(n(45).Subscription)},function(e,t,n){"use strict";n.r(t),n.d(t,"refCount",function(){return o});var r=n(40),i=n(39);function o(){return function(e){return e.lift(new s(e))}}var s=function(){function e(e){this.connectable=e}return e.prototype.call=function(e,t){var n=this.connectable;n._refCount++;var r=new a(e,n),i=t.subscribe(r);return r.closed||(r.connection=n.connect()),i},e}(),a=function(e){function t(t,n){var r=e.call(this,t)||this;return r.connectable=n,r}return r.__extends(t,e),t.prototype._unsubscribe=function(){var e=this.connectable;if(e){this.connectable=null;var t=e._refCount;if(t<=0)this.connection=null;else if(e._refCount=t-1,t>1)this.connection=null;else{var n=this.connection,r=e._connection;this.connection=null,!r||n&&r!==n||r.unsubscribe()}}else this.connection=null},t}(i.Subscriber)},function(e,t,n){"use strict";n.r(t),n.d(t,"groupBy",function(){return c}),n.d(t,"GroupedObservable",function(){return f});var r=n(40),i=n(39),o=n(45),s=n(37),a=n(56);function c(e,t,n,r){return function(i){return i.lift(new u(e,t,n,r))}}var u=function(){function e(e,t,n,r){this.keySelector=e,this.elementSelector=t,this.durationSelector=n,this.subjectSelector=r}return e.prototype.call=function(e,t){return t.subscribe(new d(e,this.keySelector,this.elementSelector,this.durationSelector,this.subjectSelector))},e}(),d=function(e){function t(t,n,r,i,o){var s=e.call(this,t)||this;return s.keySelector=n,s.elementSelector=r,s.durationSelector=i,s.subjectSelector=o,s.groups=null,s.attemptedToUnsubscribe=!1,s.count=0,s}return r.__extends(t,e),t.prototype._next=function(e){var t;try{t=this.keySelector(e)}catch(n){return void this.error(n)}this._group(e,t)},t.prototype._group=function(e,t){var n=this.groups;n||(n=this.groups=new Map);var r,i=n.get(t);if(this.elementSelector)try{r=this.elementSelector(e)}catch(c){this.error(c)}else r=e;if(!i){i=this.subjectSelector?this.subjectSelector():new a.Subject,n.set(t,i);var o=new f(t,i,this);if(this.destination.next(o),this.durationSelector){var s=void 0;try{s=this.durationSelector(new f(t,i))}catch(c){return void this.error(c)}this.add(s.subscribe(new l(t,i,this)))}}i.closed||i.next(r)},t.prototype._error=function(e){var t=this.groups;t&&(t.forEach(function(t,n){t.error(e)}),t.clear()),this.destination.error(e)},t.prototype._complete=function(){var e=this.groups;e&&(e.forEach(function(e,t){e.complete()}),e.clear()),this.destination.complete()},t.prototype.removeGroup=function(e){this.groups.delete(e)},t.prototype.unsubscribe=function(){this.closed||(this.attemptedToUnsubscribe=!0,0===this.count&&e.prototype.unsubscribe.call(this))},t}(i.Subscriber),l=function(e){function t(t,n,r){var i=e.call(this,n)||this;return i.key=t,i.group=n,i.parent=r,i}return r.__extends(t,e),t.prototype._next=function(e){this.complete()},t.prototype._unsubscribe=function(){var e=this.parent,t=this.key;this.key=this.parent=null,e&&e.removeGroup(t)},t}(i.Subscriber),f=function(e){function t(t,n,r){var i=e.call(this)||this;return i.key=t,i.groupSubject=n,i.refCountSubscription=r,i}return r.__extends(t,e),t.prototype._subscribe=function(e){var t=new o.Subscription,n=this.refCountSubscription,r=this.groupSubject;return n&&!n.closed&&t.add(new p(n)),t.add(r.subscribe(e)),t},t}(s.Observable),p=function(e){function t(t){var n=e.call(this)||this;return n.parent=t,t.count++,n}return r.__extends(t,e),t.prototype.unsubscribe=function(){var t=this.parent;t.closed||this.closed||(e.prototype.unsubscribe.call(this),t.count-=1,0===t.count&&t.attemptedToUnsubscribe&&t.unsubscribe())},t}(o.Subscription)},function(e,t,n){"use strict";n.r(t),n.d(t,"BehaviorSubject",function(){return s});var r=n(40),i=n(56),o=n(57),s=function(e){function t(t){var n=e.call(this)||this;return n._value=t,n}return r.__extends(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0}),t.prototype._subscribe=function(t){var n=e.prototype._subscribe.call(this,t);return n&&!n.closed&&t.next(this._value),n},t.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new o.ObjectUnsubscribedError;return this._value},t.prototype.next=function(t){e.prototype.next.call(this,this._value=t)},t}(i.Subject)},function(e,t,n){"use strict";n.r(t),n.d(t,"ReplaySubject",function(){return d});var r=n(40),i=n(56),o=n(63),s=n(45),a=n(70),c=n(57),u=n(58),d=function(e){function t(t,n,r){void 0===t&&(t=Number.POSITIVE_INFINITY),void 0===n&&(n=Number.POSITIVE_INFINITY);var i=e.call(this)||this;return i.scheduler=r,i._events=[],i._infiniteTimeWindow=!1,i._bufferSize=t<1?1:t,i._windowTime=n<1?1:n,n===Number.POSITIVE_INFINITY?(i._infiniteTimeWindow=!0,i.next=i.nextInfiniteTimeWindow):i.next=i.nextTimeWindow,i}return r.__extends(t,e),t.prototype.nextInfiniteTimeWindow=function(t){var n=this._events;n.push(t),n.length>this._bufferSize&&n.shift(),e.prototype.next.call(this,t)},t.prototype.nextTimeWindow=function(t){this._events.push(new l(this._getNow(),t)),this._trimBufferThenGetEvents(),e.prototype.next.call(this,t)},t.prototype._subscribe=function(e){var t,n=this._infiniteTimeWindow,r=n?this._events:this._trimBufferThenGetEvents(),i=this.scheduler,o=r.length;if(this.closed)throw new c.ObjectUnsubscribedError;if(this.isStopped||this.hasError?t=s.Subscription.EMPTY:(this.observers.push(e),t=new u.SubjectSubscription(this,e)),i&&e.add(e=new a.ObserveOnSubscriber(e,i)),n)for(var d=0;d<o&&!e.closed;d++)e.next(r[d]);else for(d=0;d<o&&!e.closed;d++)e.next(r[d].value);return this.hasError?e.error(this.thrownError):this.isStopped&&e.complete(),t},t.prototype._getNow=function(){return(this.scheduler||o.queue).now()},t.prototype._trimBufferThenGetEvents=function(){for(var e=this._getNow(),t=this._bufferSize,n=this._windowTime,r=this._events,i=r.length,o=0;o<i&&!(e-r[o].time<n);)o++;return i>t&&(o=Math.max(o,i-t)),o>0&&r.splice(0,o),r},t}(i.Subject),l=function(){return function(e,t){this.time=e,this.value=t}}()},function(e,t,n){"use strict";n.r(t),n.d(t,"queue",function(){return i});var r=n(64),i=new(n(67).QueueScheduler)(r.QueueAction)},function(e,t,n){"use strict";n.r(t),n.d(t,"QueueAction",function(){return i});var r=n(40),i=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r}return r.__extends(t,e),t.prototype.schedule=function(t,n){return void 0===n&&(n=0),n>0?e.prototype.schedule.call(this,t,n):(this.delay=n,this.state=t,this.scheduler.flush(this),this)},t.prototype.execute=function(t,n){return n>0||this.closed?e.prototype.execute.call(this,t,n):this._execute(t,n)},t.prototype.requestAsyncId=function(t,n,r){return void 0===r&&(r=0),null!==r&&r>0||null===r&&this.delay>0?e.prototype.requestAsyncId.call(this,t,n,r):t.flush(this)},t}(n(65).AsyncAction)},function(e,t,n){"use strict";n.r(t),n.d(t,"AsyncAction",function(){return i});var r=n(40),i=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r.pending=!1,r}return r.__extends(t,e),t.prototype.schedule=function(e,t){if(void 0===t&&(t=0),this.closed)return this;this.state=e;var n=this.id,r=this.scheduler;return null!=n&&(this.id=this.recycleAsyncId(r,n,t)),this.pending=!0,this.delay=t,this.id=this.id||this.requestAsyncId(r,this.id,t),this},t.prototype.requestAsyncId=function(e,t,n){return void 0===n&&(n=0),setInterval(e.flush.bind(e,this),n)},t.prototype.recycleAsyncId=function(e,t,n){if(void 0===n&&(n=0),null!==n&&this.delay===n&&!1===this.pending)return t;clearInterval(t)},t.prototype.execute=function(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var n=this._execute(e,t);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,t){var n=!1,r=void 0;try{this.work(e)}catch(i){n=!0,r=!!i&&i||new Error(i)}if(n)return this.unsubscribe(),r},t.prototype._unsubscribe=function(){var e=this.id,t=this.scheduler,n=t.actions,r=n.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==r&&n.splice(r,1),null!=e&&(this.id=this.recycleAsyncId(t,e,null)),this.delay=null},t}(n(66).Action)},function(e,t,n){"use strict";n.r(t),n.d(t,"Action",function(){return i});var r=n(40),i=function(e){function t(t,n){return e.call(this)||this}return r.__extends(t,e),t.prototype.schedule=function(e,t){return void 0===t&&(t=0),this},t}(n(45).Subscription)},function(e,t,n){"use strict";n.r(t),n.d(t,"QueueScheduler",function(){return i});var r=n(40),i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t}(n(68).AsyncScheduler)},function(e,t,n){"use strict";n.r(t),n.d(t,"AsyncScheduler",function(){return o});var r=n(40),i=n(69),o=function(e){function t(n,r){void 0===r&&(r=i.Scheduler.now);var o=e.call(this,n,function(){return t.delegate&&t.delegate!==o?t.delegate.now():r()})||this;return o.actions=[],o.active=!1,o.scheduled=void 0,o}return r.__extends(t,e),t.prototype.schedule=function(n,r,i){return void 0===r&&(r=0),t.delegate&&t.delegate!==this?t.delegate.schedule(n,r,i):e.prototype.schedule.call(this,n,r,i)},t.prototype.flush=function(e){var t=this.actions;if(this.active)t.push(e);else{var n;this.active=!0;do{if(n=e.execute(e.state,e.delay))break}while(e=t.shift());if(this.active=!1,n){for(;e=t.shift();)e.unsubscribe();throw n}}},t}(i.Scheduler)},function(e,t,n){"use strict";n.r(t),n.d(t,"Scheduler",function(){return r});var r=function(){function e(t,n){void 0===n&&(n=e.now),this.SchedulerAction=t,this.now=n}return e.prototype.schedule=function(e,t,n){return void 0===t&&(t=0),new this.SchedulerAction(this,e).schedule(n,t)},e.now=function(){return Date.now()},e}()},function(e,t,n){"use strict";n.r(t),n.d(t,"observeOn",function(){return s}),n.d(t,"ObserveOnOperator",function(){return a}),n.d(t,"ObserveOnSubscriber",function(){return c}),n.d(t,"ObserveOnMessage",function(){return u});var r=n(40),i=n(39),o=n(71);function s(e,t){return void 0===t&&(t=0),function(n){return n.lift(new a(e,t))}}var a=function(){function e(e,t){void 0===t&&(t=0),this.scheduler=e,this.delay=t}return e.prototype.call=function(e,t){return t.subscribe(new c(e,this.scheduler,this.delay))},e}(),c=function(e){function t(t,n,r){void 0===r&&(r=0);var i=e.call(this,t)||this;return i.scheduler=n,i.delay=r,i}return r.__extends(t,e),t.dispatch=function(e){var t=e.notification,n=e.destination;t.observe(n),this.unsubscribe()},t.prototype.scheduleMessage=function(e){this.add(this.scheduler.schedule(t.dispatch,this.delay,new u(e,this.destination)))},t.prototype._next=function(e){this.scheduleMessage(o.Notification.createNext(e))},t.prototype._error=function(e){this.scheduleMessage(o.Notification.createError(e))},t.prototype._complete=function(){this.scheduleMessage(o.Notification.createComplete())},t}(i.Subscriber),u=function(){return function(e,t){this.notification=e,this.destination=t}}()},function(e,t,n){"use strict";n.r(t),n.d(t,"Notification",function(){return s});var r=n(72),i=n(73),o=n(78),s=function(){function e(e,t,n){this.kind=e,this.value=t,this.error=n,this.hasValue="N"===e}return e.prototype.observe=function(e){switch(this.kind){case"N":return e.next&&e.next(this.value);case"E":return e.error&&e.error(this.error);case"C":return e.complete&&e.complete()}},e.prototype.do=function(e,t,n){switch(this.kind){case"N":return e&&e(this.value);case"E":return t&&t(this.error);case"C":return n&&n()}},e.prototype.accept=function(e,t,n){return e&&"function"==typeof e.next?this.observe(e):this.do(e,t,n)},e.prototype.toObservable=function(){switch(this.kind){case"N":return Object(i.of)(this.value);case"E":return Object(o.throwError)(this.error);case"C":return Object(r.empty)()}throw new Error("unexpected notification kind value")},e.createNext=function(t){return void 0!==t?new e("N",t):e.undefinedValueNotification},e.createError=function(t){return new e("E",void 0,t)},e.createComplete=function(){return e.completeNotification},e.completeNotification=new e("C"),e.undefinedValueNotification=new e("N",void 0),e}()},function(e,t,n){"use strict";n.r(t),n.d(t,"EMPTY",function(){return i}),n.d(t,"empty",function(){return o}),n.d(t,"emptyScheduled",function(){return s});var r=n(37),i=new r.Observable(function(e){return e.complete()});function o(e){return e?s(e):i}function s(e){return new r.Observable(function(t){return e.schedule(function(){return t.complete()})})}},function(e,t,n){"use strict";n.r(t),n.d(t,"of",function(){return a});var r=n(74),i=n(75),o=n(72),s=n(77);function a(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=e[e.length-1];switch(Object(r.isScheduler)(n)?e.pop():n=void 0,e.length){case 0:return Object(o.empty)(n);case 1:return n?Object(i.fromArray)(e,n):Object(s.scalar)(e[0]);default:return Object(i.fromArray)(e,n)}}},function(e,t,n){"use strict";function r(e){return e&&"function"==typeof e.schedule}n.r(t),n.d(t,"isScheduler",function(){return r})},function(e,t,n){"use strict";n.r(t),n.d(t,"fromArray",function(){return s});var r=n(37),i=n(45),o=n(76);function s(e,t){return t?new r.Observable(function(n){var r=new i.Subscription,o=0;return r.add(t.schedule(function(){o!==e.length?(n.next(e[o++]),n.closed||r.add(this.schedule())):n.complete()})),r}):new r.Observable(Object(o.subscribeToArray)(e))}},function(e,t,n){"use strict";n.r(t),n.d(t,"subscribeToArray",function(){return r});var r=function(e){return function(t){for(var n=0,r=e.length;n<r&&!t.closed;n++)t.next(e[n]);t.closed||t.complete()}}},function(e,t,n){"use strict";n.r(t),n.d(t,"scalar",function(){return i});var r=n(37);function i(e){var t=new r.Observable(function(t){t.next(e),t.complete()});return t._isScalar=!0,t.value=e,t}},function(e,t,n){"use strict";n.r(t),n.d(t,"throwError",function(){return i});var r=n(37);function i(e,t){return t?new r.Observable(function(n){return t.schedule(o,0,{error:e,subscriber:n})}):new r.Observable(function(t){return t.error(e)})}function o(e){var t=e.error;e.subscriber.error(t)}},function(e,t,n){"use strict";n.r(t),n.d(t,"AsyncSubject",function(){return s});var r=n(40),i=n(56),o=n(45),s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.value=null,t.hasNext=!1,t.hasCompleted=!1,t}return r.__extends(t,e),t.prototype._subscribe=function(t){return this.hasError?(t.error(this.thrownError),o.Subscription.EMPTY):this.hasCompleted&&this.hasNext?(t.next(this.value),t.complete(),o.Subscription.EMPTY):e.prototype._subscribe.call(this,t)},t.prototype.next=function(e){this.hasCompleted||(this.value=e,this.hasNext=!0)},t.prototype.error=function(t){this.hasCompleted||e.prototype.error.call(this,t)},t.prototype.complete=function(){this.hasCompleted=!0,this.hasNext&&e.prototype.next.call(this,this.value),e.prototype.complete.call(this)},t}(i.Subject)},function(e,t,n){"use strict";n.r(t),n.d(t,"asap",function(){return i});var r=n(81),i=new(n(83).AsapScheduler)(r.AsapAction)},function(e,t,n){"use strict";n.r(t),n.d(t,"AsapAction",function(){return o});var r=n(40),i=n(82),o=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r}return r.__extends(t,e),t.prototype.requestAsyncId=function(t,n,r){return void 0===r&&(r=0),null!==r&&r>0?e.prototype.requestAsyncId.call(this,t,n,r):(t.actions.push(this),t.scheduled||(t.scheduled=i.Immediate.setImmediate(t.flush.bind(t,null))))},t.prototype.recycleAsyncId=function(t,n,r){if(void 0===r&&(r=0),null!==r&&r>0||null===r&&this.delay>0)return e.prototype.recycleAsyncId.call(this,t,n,r);0===t.actions.length&&(i.Immediate.clearImmediate(n),t.scheduled=void 0)},t}(n(65).AsyncAction)},function(e,t,n){"use strict";n.r(t),n.d(t,"Immediate",function(){return o});var r=1,i={};var o={setImmediate:function(e){var t=r++;return i[t]=e,Promise.resolve().then(function(){return function(e){var t=i[e];t&&t()}(t)}),t},clearImmediate:function(e){delete i[e]}}},function(e,t,n){"use strict";n.r(t),n.d(t,"AsapScheduler",function(){return i});var r=n(40),i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.flush=function(e){this.active=!0,this.scheduled=void 0;var t,n=this.actions,r=-1,i=n.length;e=e||n.shift();do{if(t=e.execute(e.state,e.delay))break}while(++r<i&&(e=n.shift()));if(this.active=!1,t){for(;++r<i&&(e=n.shift());)e.unsubscribe();throw t}},t}(n(68).AsyncScheduler)},function(e,t,n){"use strict";n.r(t),n.d(t,"async",function(){return i});var r=n(65),i=new(n(68).AsyncScheduler)(r.AsyncAction)},function(e,t,n){"use strict";n.r(t),n.d(t,"animationFrame",function(){return i});var r=n(86),i=new(n(87).AnimationFrameScheduler)(r.AnimationFrameAction)},function(e,t,n){"use strict";n.r(t),n.d(t,"AnimationFrameAction",function(){return i});var r=n(40),i=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r}return r.__extends(t,e),t.prototype.requestAsyncId=function(t,n,r){return void 0===r&&(r=0),null!==r&&r>0?e.prototype.requestAsyncId.call(this,t,n,r):(t.actions.push(this),t.scheduled||(t.scheduled=requestAnimationFrame(function(){return t.flush(null)})))},t.prototype.recycleAsyncId=function(t,n,r){if(void 0===r&&(r=0),null!==r&&r>0||null===r&&this.delay>0)return e.prototype.recycleAsyncId.call(this,t,n,r);0===t.actions.length&&(cancelAnimationFrame(n),t.scheduled=void 0)},t}(n(65).AsyncAction)},function(e,t,n){"use strict";n.r(t),n.d(t,"AnimationFrameScheduler",function(){return i});var r=n(40),i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.flush=function(e){this.active=!0,this.scheduled=void 0;var t,n=this.actions,r=-1,i=n.length;e=e||n.shift();do{if(t=e.execute(e.state,e.delay))break}while(++r<i&&(e=n.shift()));if(this.active=!1,t){for(;++r<i&&(e=n.shift());)e.unsubscribe();throw t}},t}(n(68).AsyncScheduler)},function(e,t,n){"use strict";n.r(t),n.d(t,"VirtualTimeScheduler",function(){return o}),n.d(t,"VirtualAction",function(){return s});var r=n(40),i=n(65),o=function(e){function t(t,n){void 0===t&&(t=s),void 0===n&&(n=Number.POSITIVE_INFINITY);var r=e.call(this,t,function(){return r.frame})||this;return r.maxFrames=n,r.frame=0,r.index=-1,r}return r.__extends(t,e),t.prototype.flush=function(){for(var e,t,n=this.actions,r=this.maxFrames;(t=n.shift())&&(this.frame=t.delay)<=r&&!(e=t.execute(t.state,t.delay)););if(e){for(;t=n.shift();)t.unsubscribe();throw e}},t.frameTimeFactor=10,t}(n(68).AsyncScheduler),s=function(e){function t(t,n,r){void 0===r&&(r=t.index+=1);var i=e.call(this,t,n)||this;return i.scheduler=t,i.work=n,i.index=r,i.active=!0,i.index=t.index=r,i}return r.__extends(t,e),t.prototype.schedule=function(n,r){if(void 0===r&&(r=0),!this.id)return e.prototype.schedule.call(this,n,r);this.active=!1;var i=new t(this.scheduler,this.work);return this.add(i),i.schedule(n,r)},t.prototype.requestAsyncId=function(e,n,r){void 0===r&&(r=0),this.delay=e.frame+r;var i=e.actions;return i.push(this),i.sort(t.sortActions),!0},t.prototype.recycleAsyncId=function(e,t,n){void 0===n&&(n=0)},t.prototype._execute=function(t,n){if(!0===this.active)return e.prototype._execute.call(this,t,n)},t.sortActions=function(e,t){return e.delay===t.delay?e.index===t.index?0:e.index>t.index?1:-1:e.delay>t.delay?1:-1},t}(i.AsyncAction)},function(e,t,n){"use strict";function r(e){return e}n.r(t),n.d(t,"identity",function(){return r})},function(e,t,n){"use strict";n.r(t),n.d(t,"isObservable",function(){return i});var r=n(37);function i(e){return!!e&&(e instanceof r.Observable||"function"==typeof e.lift&&"function"==typeof e.subscribe)}},function(e,t,n){"use strict";n.r(t),n.d(t,"ArgumentOutOfRangeError",function(){return i});var r=n(40),i=function(e){function t(){var n=e.call(this,"argument out of range")||this;return n.name="ArgumentOutOfRangeError",Object.setPrototypeOf(n,t.prototype),n}return r.__extends(t,e),t}(Error)},function(e,t,n){"use strict";n.r(t),n.d(t,"EmptyError",function(){return i});var r=n(40),i=function(e){function t(){var n=e.call(this,"no elements in sequence")||this;return n.name="EmptyError",Object.setPrototypeOf(n,t.prototype),n}return r.__extends(t,e),t}(Error)},function(e,t,n){"use strict";n.r(t),n.d(t,"TimeoutError",function(){return i});var r=n(40),i=function(e){function t(){var n=e.call(this,"Timeout has occurred")||this;return n.name="TimeoutError",Object.setPrototypeOf(n,t.prototype),n}return r.__extends(t,e),t}(Error)},function(e,t,n){"use strict";n.r(t),n.d(t,"bindCallback",function(){return c});var r=n(37),i=n(79),o=n(95),s=n(46),a=n(74);function c(e,t,n){if(t){if(!Object(a.isScheduler)(t))return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return c(e,n).apply(void 0,r).pipe(Object(o.map)(function(e){return Object(s.isArray)(e)?t.apply(void 0,e):t(e)}))};n=t}return function(){for(var t=[],o=0;o<arguments.length;o++)t[o]=arguments[o];var s,a=this,c={context:a,subject:s,callbackFunc:e,scheduler:n};return new r.Observable(function(r){if(n){var o={args:t,subscriber:r,params:c};return n.schedule(u,0,o)}if(!s){s=new i.AsyncSubject;try{e.apply(a,t.concat([function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];s.next(e.length<=1?e[0]:e),s.complete()}]))}catch(d){s.error(d)}}return s.subscribe(r)})}}function u(e){var t=this,n=e.args,r=e.subscriber,o=e.params,s=o.callbackFunc,a=o.context,c=o.scheduler,u=o.subject;if(!u){u=o.subject=new i.AsyncSubject;try{s.apply(a,n.concat([function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=e.length<=1?e[0]:e;t.add(c.schedule(d,0,{value:r,subject:u}))}]))}catch(l){u.error(l)}}this.add(u.subscribe(r))}function d(e){var t=e.value,n=e.subject;n.next(t),n.complete()}},function(e,t,n){"use strict";n.r(t),n.d(t,"map",function(){return o}),n.d(t,"MapOperator",function(){return s});var r=n(40),i=n(39);function o(e,t){return function(n){if("function"!=typeof e)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return n.lift(new s(e,t))}}var s=function(){function e(e,t){this.project=e,this.thisArg=t}return e.prototype.call=function(e,t){return t.subscribe(new a(e,this.project,this.thisArg))},e}(),a=function(e){function t(t,n,r){var i=e.call(this,t)||this;return i.project=n,i.count=0,i.thisArg=r||i,i}return r.__extends(t,e),t.prototype._next=function(e){var t;try{t=this.project.call(this.thisArg,e,this.count++)}catch(n){return void this.destination.error(n)}this.destination.next(t)},t}(i.Subscriber)},function(e,t,n){"use strict";n.r(t),n.d(t,"bindNodeCallback",function(){return c});var r=n(37),i=n(79),o=n(95),s=n(74),a=n(46);function c(e,t,n){if(t){if(!Object(s.isScheduler)(t))return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return c(e,n).apply(void 0,r).pipe(Object(o.map)(function(e){return Object(a.isArray)(e)?t.apply(void 0,e):t(e)}))};n=t}return function(){for(var t=[],o=0;o<arguments.length;o++)t[o]=arguments[o];var s={subject:void 0,args:t,callbackFunc:e,scheduler:n,context:this};return new r.Observable(function(r){var o=s.context,a=s.subject;if(n)return n.schedule(u,0,{params:s,subscriber:r,context:o});if(!a){a=s.subject=new i.AsyncSubject;try{e.apply(o,t.concat([function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=e.shift();n?a.error(n):(a.next(e.length<=1?e[0]:e),a.complete())}]))}catch(c){a.error(c)}}return a.subscribe(r)})}}function u(e){var t=this,n=e.params,r=e.subscriber,o=e.context,s=n.callbackFunc,a=n.args,c=n.scheduler,u=n.subject;if(!u){u=n.subject=new i.AsyncSubject;try{s.apply(o,a.concat([function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=e.shift();if(r)t.add(c.schedule(l,0,{err:r,subject:u}));else{var i=e.length<=1?e[0]:e;t.add(c.schedule(d,0,{value:i,subject:u}))}}]))}catch(f){this.add(c.schedule(l,0,{err:f,subject:u}))}}this.add(u.subscribe(r))}function d(e){var t=e.value,n=e.subject;n.next(t),n.complete()}function l(e){var t=e.err;e.subject.error(t)}},function(e,t,n){"use strict";n.r(t),n.d(t,"combineLatest",function(){return d}),n.d(t,"CombineLatestOperator",function(){return l}),n.d(t,"CombineLatestSubscriber",function(){return f});var r=n(40),i=n(74),o=n(46),s=n(98),a=n(99),c=n(75),u={};function d(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=null,r=null;return Object(i.isScheduler)(e[e.length-1])&&(r=e.pop()),"function"==typeof e[e.length-1]&&(n=e.pop()),1===e.length&&Object(o.isArray)(e[0])&&(e=e[0]),Object(c.fromArray)(e,r).lift(new l(n))}var l=function(){function e(e){this.resultSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new f(e,this.resultSelector))},e}(),f=function(e){function t(t,n){var r=e.call(this,t)||this;return r.resultSelector=n,r.active=0,r.values=[],r.observables=[],r}return r.__extends(t,e),t.prototype._next=function(e){this.values.push(u),this.observables.push(e)},t.prototype._complete=function(){var e=this.observables,t=e.length;if(0===t)this.destination.complete();else{this.active=t,this.toRespond=t;for(var n=0;n<t;n++){var r=e[n];this.add(Object(a.subscribeToResult)(this,r,r,n))}}},t.prototype.notifyComplete=function(e){0==(this.active-=1)&&this.destination.complete()},t.prototype.notifyNext=function(e,t,n,r,i){var o=this.values,s=o[n],a=this.toRespond?s===u?--this.toRespond:this.toRespond:0;o[n]=t,0===a&&(this.resultSelector?this._tryResultSelector(o):this.destination.next(o.slice()))},t.prototype._tryResultSelector=function(e){var t;try{t=this.resultSelector.apply(this,e)}catch(n){return void this.destination.error(n)}this.destination.next(t)},t}(s.OuterSubscriber)},function(e,t,n){"use strict";n.r(t),n.d(t,"OuterSubscriber",function(){return i});var r=n(40),i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.notifyNext=function(e,t,n,r,i){this.destination.next(t)},t.prototype.notifyError=function(e,t){this.destination.error(e)},t.prototype.notifyComplete=function(e){this.destination.complete()},t}(n(39).Subscriber)},function(e,t,n){"use strict";n.r(t),n.d(t,"subscribeToResult",function(){return o});var r=n(100),i=n(101);function o(e,t,n,o){var s=new r.InnerSubscriber(e,n,o);return Object(i.subscribeTo)(t)(s)}},function(e,t,n){"use strict";n.r(t),n.d(t,"InnerSubscriber",function(){return i});var r=n(40),i=function(e){function t(t,n,r){var i=e.call(this)||this;return i.parent=t,i.outerValue=n,i.outerIndex=r,i.index=0,i}return r.__extends(t,e),t.prototype._next=function(e){this.parent.notifyNext(this.outerValue,e,this.outerIndex,this.index++,this)},t.prototype._error=function(e){this.parent.notifyError(e,this),this.unsubscribe()},t.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},t}(n(39).Subscriber)},function(e,t,n){"use strict";n.r(t),n.d(t,"subscribeTo",function(){return p});var r=n(37),i=n(76),o=n(102),s=n(103),a=n(105),c=n(106),u=n(107),d=n(47),l=n(104),f=n(52),p=function(e){if(e instanceof r.Observable)return function(t){return e._isScalar?(t.next(e.value),void t.complete()):e.subscribe(t)};if(e&&"function"==typeof e[f.observable])return Object(a.subscribeToObservable)(e);if(Object(c.isArrayLike)(e))return Object(i.subscribeToArray)(e);if(Object(u.isPromise)(e))return Object(o.subscribeToPromise)(e);if(e&&"function"==typeof e[l.iterator])return Object(s.subscribeToIterable)(e);var t=Object(d.isObject)(e)?"an invalid object":"'"+e+"'";throw new TypeError("You provided "+t+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.")}},function(e,t,n){"use strict";n.r(t),n.d(t,"subscribeToPromise",function(){return i});var r=n(44),i=function(e){return function(t){return e.then(function(e){t.closed||(t.next(e),t.complete())},function(e){return t.error(e)}).then(null,r.hostReportError),t}}},function(e,t,n){"use strict";n.r(t),n.d(t,"subscribeToIterable",function(){return i});var r=n(104),i=function(e){return function(t){for(var n=e[r.iterator]();;){var i=n.next();if(i.done){t.complete();break}if(t.next(i.value),t.closed)break}return"function"==typeof n.return&&t.add(function(){n.return&&n.return()}),t}}},function(e,t,n){"use strict";function r(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}n.r(t),n.d(t,"getSymbolIterator",function(){return r}),n.d(t,"iterator",function(){return i}),n.d(t,"$$iterator",function(){return o});var i=r(),o=i},function(e,t,n){"use strict";n.r(t),n.d(t,"subscribeToObservable",function(){return i});var r=n(52),i=function(e){return function(t){var n=e[r.observable]();if("function"!=typeof n.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return n.subscribe(t)}}},function(e,t,n){"use strict";n.r(t),n.d(t,"isArrayLike",function(){return r});var r=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e}},function(e,t,n){"use strict";function r(e){return e&&"function"!=typeof e.subscribe&&"function"==typeof e.then}n.r(t),n.d(t,"isPromise",function(){return r})},function(e,t,n){"use strict";n.r(t),n.d(t,"concat",function(){return a});var r=n(74),i=n(73),o=n(109),s=n(115);function a(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 1===e.length||2===e.length&&Object(r.isScheduler)(e[1])?Object(o.from)(e[0]):Object(s.concatAll)()(i.of.apply(void 0,e))}},function(e,t,n){"use strict";n.r(t),n.d(t,"from",function(){return p});var r=n(37),i=n(107),o=n(106),s=n(110),a=n(111),c=n(75),u=n(112),d=n(113),l=n(114),f=n(101);function p(e,t){if(!t)return e instanceof r.Observable?e:new r.Observable(Object(f.subscribeTo)(e));if(null!=e){if(Object(s.isInteropObservable)(e))return Object(l.fromObservable)(e,t);if(Object(i.isPromise)(e))return Object(u.fromPromise)(e,t);if(Object(o.isArrayLike)(e))return Object(c.fromArray)(e,t);if(Object(a.isIterable)(e)||"string"==typeof e)return Object(d.fromIterable)(e,t)}throw new TypeError((null!==e&&typeof e||e)+" is not observable")}},function(e,t,n){"use strict";n.r(t),n.d(t,"isInteropObservable",function(){return i});var r=n(52);function i(e){return e&&"function"==typeof e[r.observable]}},function(e,t,n){"use strict";n.r(t),n.d(t,"isIterable",function(){return i});var r=n(104);function i(e){return e&&"function"==typeof e[r.iterator]}},function(e,t,n){"use strict";n.r(t),n.d(t,"fromPromise",function(){return s});var r=n(37),i=n(45),o=n(102);function s(e,t){return t?new r.Observable(function(n){var r=new i.Subscription;return r.add(t.schedule(function(){return e.then(function(e){r.add(t.schedule(function(){n.next(e),r.add(t.schedule(function(){return n.complete()}))}))},function(e){r.add(t.schedule(function(){return n.error(e)}))})})),r}):new r.Observable(Object(o.subscribeToPromise)(e))}},function(e,t,n){"use strict";n.r(t),n.d(t,"fromIterable",function(){return a});var r=n(37),i=n(45),o=n(104),s=n(103);function a(e,t){if(!e)throw new Error("Iterable cannot be null");return t?new r.Observable(function(n){var r,s=new i.Subscription;return s.add(function(){r&&"function"==typeof r.return&&r.return()}),s.add(t.schedule(function(){r=e[o.iterator](),s.add(t.schedule(function(){if(!n.closed){var e,t;try{var i=r.next();e=i.value,t=i.done}catch(o){return void n.error(o)}t?n.complete():(n.next(e),this.schedule())}}))})),s}):new r.Observable(Object(s.subscribeToIterable)(e))}},function(e,t,n){"use strict";n.r(t),n.d(t,"fromObservable",function(){return a});var r=n(37),i=n(45),o=n(52),s=n(105);function a(e,t){return t?new r.Observable(function(n){var r=new i.Subscription;return r.add(t.schedule(function(){var i=e[o.observable]();r.add(i.subscribe({next:function(e){r.add(t.schedule(function(){return n.next(e)}))},error:function(e){r.add(t.schedule(function(){return n.error(e)}))},complete:function(){r.add(t.schedule(function(){return n.complete()}))}}))})),r}):new r.Observable(Object(s.subscribeToObservable)(e))}},function(e,t,n){"use strict";n.r(t),n.d(t,"concatAll",function(){return i});var r=n(116);function i(){return Object(r.mergeAll)(1)}},function(e,t,n){"use strict";n.r(t),n.d(t,"mergeAll",function(){return o});var r=n(117),i=n(89);function o(e){return void 0===e&&(e=Number.POSITIVE_INFINITY),Object(r.mergeMap)(i.identity,e)}},function(e,t,n){"use strict";n.r(t),n.d(t,"mergeMap",function(){return c}),n.d(t,"MergeMapOperator",function(){return u}),n.d(t,"MergeMapSubscriber",function(){return d});var r=n(40),i=n(99),o=n(98),s=n(95),a=n(109);function c(e,t,n){return void 0===n&&(n=Number.POSITIVE_INFINITY),"function"==typeof t?function(r){return r.pipe(c(function(n,r){return Object(a.from)(e(n,r)).pipe(Object(s.map)(function(e,i){return t(n,e,r,i)}))},n))}:("number"==typeof t&&(n=t),function(t){return t.lift(new u(e,n))})}var u=function(){function e(e,t){void 0===t&&(t=Number.POSITIVE_INFINITY),this.project=e,this.concurrent=t}return e.prototype.call=function(e,t){return t.subscribe(new d(e,this.project,this.concurrent))},e}(),d=function(e){function t(t,n,r){void 0===r&&(r=Number.POSITIVE_INFINITY);var i=e.call(this,t)||this;return i.project=n,i.concurrent=r,i.hasCompleted=!1,i.buffer=[],i.active=0,i.index=0,i}return r.__extends(t,e),t.prototype._next=function(e){this.active<this.concurrent?this._tryNext(e):this.buffer.push(e)},t.prototype._tryNext=function(e){var t,n=this.index++;try{t=this.project(e,n)}catch(r){return void this.destination.error(r)}this.active++,this._innerSub(t,e,n)},t.prototype._innerSub=function(e,t,n){this.add(Object(i.subscribeToResult)(this,e,t,n))},t.prototype._complete=function(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&this.destination.complete()},t.prototype.notifyNext=function(e,t,n,r,i){this.destination.next(t)},t.prototype.notifyComplete=function(e){var t=this.buffer;this.remove(e),this.active--,t.length>0?this._next(t.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},t}(o.OuterSubscriber)},function(e,t,n){"use strict";n.r(t),n.d(t,"defer",function(){return s});var r=n(37),i=n(109),o=n(72);function s(e){return new r.Observable(function(t){var n;try{n=e()}catch(r){return void t.error(r)}return(n?Object(i.from)(n):Object(o.empty)()).subscribe(t)})}},function(e,t,n){"use strict";n.r(t),n.d(t,"forkJoin",function(){return d});var r=n(40),i=n(37),o=n(46),s=n(72),a=n(99),c=n(98),u=n(95);function d(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return"function"==typeof t[t.length-1]&&(e=t.pop()),1===t.length&&Object(o.isArray)(t[0])&&(t=t[0]),0===t.length?s.EMPTY:e?d(t).pipe(Object(u.map)(function(t){return e.apply(void 0,t)})):new i.Observable(function(e){return new l(e,t)})}var l=function(e){function t(t,n){var r=e.call(this,t)||this;r.sources=n,r.completed=0,r.haveValues=0;var i=n.length;r.values=new Array(i);for(var o=0;o<i;o++){var s=n[o],c=Object(a.subscribeToResult)(r,s,null,o);c&&r.add(c)}return r}return r.__extends(t,e),t.prototype.notifyNext=function(e,t,n,r,i){this.values[n]=t,i._hasValue||(i._hasValue=!0,this.haveValues++)},t.prototype.notifyComplete=function(e){var t=this.destination,n=this.haveValues,r=this.values,i=r.length;e._hasValue?(this.completed++,this.completed===i&&(n===i&&t.next(r),t.complete())):t.complete()},t}(c.OuterSubscriber)},function(e,t,n){"use strict";n.r(t),n.d(t,"fromEvent",function(){return a});var r=n(37),i=n(46),o=n(41),s=n(95);Object.prototype.toString;function a(e,t,n,c){return Object(o.isFunction)(n)&&(c=n,n=void 0),c?a(e,t,n).pipe(Object(s.map)(function(e){return Object(i.isArray)(e)?c.apply(void 0,e):c(e)})):new r.Observable(function(r){!function e(t,n,r,i,o){var s;if(function(e){return e&&"function"==typeof e.addEventListener&&"function"==typeof e.removeEventListener}(t)){var a=t;t.addEventListener(n,r,o),s=function(){return a.removeEventListener(n,r,o)}}else if(function(e){return e&&"function"==typeof e.on&&"function"==typeof e.off}(t)){var c=t;t.on(n,r),s=function(){return c.off(n,r)}}else if(function(e){return e&&"function"==typeof e.addListener&&"function"==typeof e.removeListener}(t)){var u=t;t.addListener(n,r),s=function(){return u.removeListener(n,r)}}else{if(!t||!t.length)throw new TypeError("Invalid event target");for(var d=0,l=t.length;d<l;d++)e(t[d],n,r,i,o)}i.add(s)}(e,t,function(e){arguments.length>1?r.next(Array.prototype.slice.call(arguments)):r.next(e)},r,n)})}},function(e,t,n){"use strict";n.r(t),n.d(t,"fromEventPattern",function(){return a});var r=n(37),i=n(46),o=n(41),s=n(95);function a(e,t,n){return n?a(e,t).pipe(Object(s.map)(function(e){return Object(i.isArray)(e)?n.apply(void 0,e):n(e)})):new r.Observable(function(n){var r,i=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return n.next(1===e.length?e[0]:e)};try{r=e(i)}catch(s){return void n.error(s)}if(Object(o.isFunction)(t))return function(){return t(i,r)}})}},function(e,t,n){"use strict";n.r(t),n.d(t,"generate",function(){return s});var r=n(37),i=n(89),o=n(74);function s(e,t,n,s,c){var u,d;if(1==arguments.length){var l=e;d=l.initialState,t=l.condition,n=l.iterate,u=l.resultSelector||i.identity,c=l.scheduler}else void 0===s||Object(o.isScheduler)(s)?(d=e,u=i.identity,c=s):(d=e,u=s);return new r.Observable(function(e){var r=d;if(c)return c.schedule(a,0,{subscriber:e,iterate:n,condition:t,resultSelector:u,state:r});for(;;){if(t){var i=void 0;try{i=t(r)}catch(s){return void e.error(s)}if(!i){e.complete();break}}var o=void 0;try{o=u(r)}catch(s){return void e.error(s)}if(e.next(o),e.closed)break;try{r=n(r)}catch(s){return void e.error(s)}}})}function a(e){var t=e.subscriber,n=e.condition;if(!t.closed){if(e.needIterate)try{e.state=e.iterate(e.state)}catch(o){return void t.error(o)}else e.needIterate=!0;if(n){var r=void 0;try{r=n(e.state)}catch(o){return void t.error(o)}if(!r)return void t.complete();if(t.closed)return}var i;try{i=e.resultSelector(e.state)}catch(o){return void t.error(o)}if(!t.closed&&(t.next(i),!t.closed))return this.schedule(e)}}},function(e,t,n){"use strict";n.r(t),n.d(t,"iif",function(){return o});var r=n(118),i=n(72);function o(e,t,n){return void 0===t&&(t=i.EMPTY),void 0===n&&(n=i.EMPTY),Object(r.defer)(function(){return e()?t:n})}},function(e,t,n){"use strict";n.r(t),n.d(t,"interval",function(){return s});var r=n(37),i=n(84),o=n(125);function s(e,t){return void 0===e&&(e=0),void 0===t&&(t=i.async),(!Object(o.isNumeric)(e)||e<0)&&(e=0),t&&"function"==typeof t.schedule||(t=i.async),new r.Observable(function(n){return n.add(t.schedule(a,e,{subscriber:n,counter:0,period:e})),n})}function a(e){var t=e.subscriber,n=e.counter,r=e.period;t.next(n),this.schedule({subscriber:t,counter:n+1,period:r},r)}},function(e,t,n){"use strict";n.r(t),n.d(t,"isNumeric",function(){return i});var r=n(46);function i(e){return!Object(r.isArray)(e)&&e-parseFloat(e)+1>=0}},function(e,t,n){"use strict";n.r(t),n.d(t,"merge",function(){return a});var r=n(37),i=n(74),o=n(116),s=n(75);function a(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=Number.POSITIVE_INFINITY,a=null,c=e[e.length-1];return Object(i.isScheduler)(c)?(a=e.pop(),e.length>1&&"number"==typeof e[e.length-1]&&(n=e.pop())):"number"==typeof c&&(n=e.pop()),null===a&&1===e.length&&e[0]instanceof r.Observable?e[0]:Object(o.mergeAll)(n)(Object(s.fromArray)(e,a))}},function(e,t,n){"use strict";n.r(t),n.d(t,"NEVER",function(){return o}),n.d(t,"never",function(){return s});var r=n(37),i=n(54),o=new r.Observable(i.noop);function s(){return o}},function(e,t,n){"use strict";n.r(t),n.d(t,"onErrorResumeNext",function(){return a});var r=n(37),i=n(109),o=n(46),s=n(72);function a(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(0===e.length)return s.EMPTY;var n=e[0],c=e.slice(1);return 1===e.length&&Object(o.isArray)(n)?a.apply(void 0,n):new r.Observable(function(e){var t=function(){return e.add(a.apply(void 0,c).subscribe(e))};return Object(i.from)(n).subscribe({next:function(t){e.next(t)},error:t,complete:t})})}},function(e,t,n){"use strict";n.r(t),n.d(t,"pairs",function(){return o}),n.d(t,"dispatch",function(){return s});var r=n(37),i=n(45);function o(e,t){return t?new r.Observable(function(n){var r=Object.keys(e),o=new i.Subscription;return o.add(t.schedule(s,0,{keys:r,index:0,subscriber:n,subscription:o,obj:e})),o}):new r.Observable(function(t){for(var n=Object.keys(e),r=0;r<n.length&&!t.closed;r++){var i=n[r];e.hasOwnProperty(i)&&t.next([i,e[i]])}t.complete()})}function s(e){var t=e.keys,n=e.index,r=e.subscriber,i=e.subscription,o=e.obj;if(!r.closed)if(n<t.length){var s=t[n];r.next([s,o[s]]),i.add(this.schedule({keys:t,index:n+1,subscriber:r,subscription:i,obj:o}))}else r.complete()}},function(e,t,n){"use strict";n.r(t),n.d(t,"race",function(){return c}),n.d(t,"RaceOperator",function(){return u}),n.d(t,"RaceSubscriber",function(){return d});var r=n(40),i=n(46),o=n(75),s=n(98),a=n(99);function c(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(1===e.length){if(!Object(i.isArray)(e[0]))return e[0];e=e[0]}return Object(o.fromArray)(e,void 0).lift(new u)}var u=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new d(e))},e}(),d=function(e){function t(t){var n=e.call(this,t)||this;return n.hasFirst=!1,n.observables=[],n.subscriptions=[],n}return r.__extends(t,e),t.prototype._next=function(e){this.observables.push(e)},t.prototype._complete=function(){var e=this.observables,t=e.length;if(0===t)this.destination.complete();else{for(var n=0;n<t&&!this.hasFirst;n++){var r=e[n],i=Object(a.subscribeToResult)(this,r,r,n);this.subscriptions&&this.subscriptions.push(i),this.add(i)}this.observables=null}},t.prototype.notifyNext=function(e,t,n,r,i){if(!this.hasFirst){this.hasFirst=!0;for(var o=0;o<this.subscriptions.length;o++)if(o!==n){var s=this.subscriptions[o];s.unsubscribe(),this.remove(s)}this.subscriptions=null}this.destination.next(t)},t}(s.OuterSubscriber)},function(e,t,n){"use strict";n.r(t),n.d(t,"range",function(){return i}),n.d(t,"dispatch",function(){return o});var r=n(37);function i(e,t,n){return void 0===e&&(e=0),void 0===t&&(t=0),new r.Observable(function(r){var i=0,s=e;if(n)return n.schedule(o,0,{index:i,count:t,start:e,subscriber:r});for(;;){if(i++>=t){r.complete();break}if(r.next(s++),r.closed)break}})}function o(e){var t=e.start,n=e.index,r=e.count,i=e.subscriber;n>=r?i.complete():(i.next(t),i.closed||(e.index=n+1,e.start=t+1,this.schedule(e)))}},function(e,t,n){"use strict";n.r(t),n.d(t,"timer",function(){return a});var r=n(37),i=n(84),o=n(125),s=n(74);function a(e,t,n){void 0===e&&(e=0);var a=-1;return Object(o.isNumeric)(t)?a=Number(t)<1?1:Number(t):Object(s.isScheduler)(t)&&(n=t),Object(s.isScheduler)(n)||(n=i.async),new r.Observable(function(t){var r=Object(o.isNumeric)(e)?e:+e-n.now();return n.schedule(c,r,{index:0,period:a,subscriber:t})})}function c(e){var t=e.index,n=e.period,r=e.subscriber;if(r.next(t),!r.closed){if(-1===n)return r.complete();e.index=t+1,this.schedule(e,n)}}},function(e,t,n){"use strict";n.r(t),n.d(t,"using",function(){return s});var r=n(37),i=n(109),o=n(72);function s(e,t){return new r.Observable(function(n){var r,s;try{r=e()}catch(c){return void n.error(c)}try{s=t(r)}catch(c){return void n.error(c)}var a=(s?Object(i.from)(s):o.EMPTY).subscribe(n);return function(){a.unsubscribe(),r&&r.unsubscribe()}})}},function(e,t,n){"use strict";n.r(t),n.d(t,"zip",function(){return d}),n.d(t,"ZipOperator",function(){return l}),n.d(t,"ZipSubscriber",function(){return f});var r=n(40),i=n(75),o=n(46),s=n(39),a=n(98),c=n(99),u=n(104);function d(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=e[e.length-1];return"function"==typeof n&&e.pop(),Object(i.fromArray)(e,void 0).lift(new l(n))}var l=function(){function e(e){this.resultSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new f(e,this.resultSelector))},e}(),f=function(e){function t(t,n,r){void 0===r&&(r=Object.create(null));var i=e.call(this,t)||this;return i.iterators=[],i.active=0,i.resultSelector="function"==typeof n?n:null,i.values=r,i}return r.__extends(t,e),t.prototype._next=function(e){var t=this.iterators;Object(o.isArray)(e)?t.push(new h(e)):"function"==typeof e[u.iterator]?t.push(new p(e[u.iterator]())):t.push(new m(this.destination,this,e))},t.prototype._complete=function(){var e=this.iterators,t=e.length;if(0!==t){this.active=t;for(var n=0;n<t;n++){var r=e[n];r.stillUnsubscribed?this.add(r.subscribe(r,n)):this.active--}}else this.destination.complete()},t.prototype.notifyInactive=function(){this.active--,0===this.active&&this.destination.complete()},t.prototype.checkIterators=function(){for(var e=this.iterators,t=e.length,n=this.destination,r=0;r<t;r++){if("function"==typeof(s=e[r]).hasValue&&!s.hasValue())return}var i=!1,o=[];for(r=0;r<t;r++){var s,a=(s=e[r]).next();if(s.hasCompleted()&&(i=!0),a.done)return void n.complete();o.push(a.value)}this.resultSelector?this._tryresultSelector(o):n.next(o),i&&n.complete()},t.prototype._tryresultSelector=function(e){var t;try{t=this.resultSelector.apply(this,e)}catch(n){return void this.destination.error(n)}this.destination.next(t)},t}(s.Subscriber),p=function(){function e(e){this.iterator=e,this.nextResult=e.next()}return e.prototype.hasValue=function(){return!0},e.prototype.next=function(){var e=this.nextResult;return this.nextResult=this.iterator.next(),e},e.prototype.hasCompleted=function(){var e=this.nextResult;return e&&e.done},e}(),h=function(){function e(e){this.array=e,this.index=0,this.length=0,this.length=e.length}return e.prototype[u.iterator]=function(){return this},e.prototype.next=function(e){var t=this.index++,n=this.array;return t<this.length?{value:n[t],done:!1}:{value:null,done:!0}},e.prototype.hasValue=function(){return this.array.length>this.index},e.prototype.hasCompleted=function(){return this.array.length===this.index},e}(),m=function(e){function t(t,n,r){var i=e.call(this,t)||this;return i.parent=n,i.observable=r,i.stillUnsubscribed=!0,i.buffer=[],i.isComplete=!1,i}return r.__extends(t,e),t.prototype[u.iterator]=function(){return this},t.prototype.next=function(){var e=this.buffer;return 0===e.length&&this.isComplete?{value:null,done:!0}:{value:e.shift(),done:!1}},t.prototype.hasValue=function(){return this.buffer.length>0},t.prototype.hasCompleted=function(){return 0===this.buffer.length&&this.isComplete},t.prototype.notifyComplete=function(){this.buffer.length>0?(this.isComplete=!0,this.parent.notifyInactive()):this.destination.complete()},t.prototype.notifyNext=function(e,t,n,r,i){this.buffer.push(t),this.parent.checkIterators()},t.prototype.subscribe=function(e,t){return Object(c.subscribeToResult)(this,this.observable,this,t)},t}(a.OuterSubscriber)},function(e,t,n){"use strict";n.r(t);var r=n(136);n.d(t,"audit",function(){return r.audit});var i=n(137);n.d(t,"auditTime",function(){return i.auditTime});var o=n(138);n.d(t,"buffer",function(){return o.buffer});var s=n(139);n.d(t,"bufferCount",function(){return s.bufferCount});var a=n(140);n.d(t,"bufferTime",function(){return a.bufferTime});var c=n(141);n.d(t,"bufferToggle",function(){return c.bufferToggle});var u=n(142);n.d(t,"bufferWhen",function(){return u.bufferWhen});var d=n(143);n.d(t,"catchError",function(){return d.catchError});var l=n(144);n.d(t,"combineAll",function(){return l.combineAll});var f=n(145);n.d(t,"combineLatest",function(){return f.combineLatest});var p=n(146);n.d(t,"concat",function(){return p.concat});var h=n(115);n.d(t,"concatAll",function(){return h.concatAll});var m=n(147);n.d(t,"concatMap",function(){return m.concatMap});var v=n(148);n.d(t,"concatMapTo",function(){return v.concatMapTo});var b=n(149);n.d(t,"count",function(){return b.count});var g=n(150);n.d(t,"debounce",function(){return g.debounce});var _=n(151);n.d(t,"debounceTime",function(){return _.debounceTime});var y=n(152);n.d(t,"defaultIfEmpty",function(){return y.defaultIfEmpty});var S=n(153);n.d(t,"delay",function(){return S.delay});var w=n(155);n.d(t,"delayWhen",function(){return w.delayWhen});var x=n(156);n.d(t,"dematerialize",function(){return x.dematerialize});var C=n(157);n.d(t,"distinct",function(){return C.distinct});var E=n(158);n.d(t,"distinctUntilChanged",function(){return E.distinctUntilChanged});var T=n(159);n.d(t,"distinctUntilKeyChanged",function(){return T.distinctUntilKeyChanged});var I=n(160);n.d(t,"elementAt",function(){return I.elementAt});var R=n(165);n.d(t,"endWith",function(){return R.endWith});var k=n(166);n.d(t,"every",function(){return k.every});var O=n(167);n.d(t,"exhaust",function(){return O.exhaust});var M=n(168);n.d(t,"exhaustMap",function(){return M.exhaustMap});var A=n(169);n.d(t,"expand",function(){return A.expand});var P=n(161);n.d(t,"filter",function(){return P.filter});var j=n(170);n.d(t,"finalize",function(){return j.finalize});var N=n(171);n.d(t,"find",function(){return N.find});var D=n(172);n.d(t,"findIndex",function(){return D.findIndex});var L=n(173);n.d(t,"first",function(){return L.first});var V=n(60);n.d(t,"groupBy",function(){return V.groupBy});var F=n(174);n.d(t,"ignoreElements",function(){return F.ignoreElements});var U=n(175);n.d(t,"isEmpty",function(){return U.isEmpty});var W=n(176);n.d(t,"last",function(){return W.last});var B=n(95);n.d(t,"map",function(){return B.map});var z=n(178);n.d(t,"mapTo",function(){return z.mapTo});var $=n(179);n.d(t,"materialize",function(){return $.materialize});var q=n(180);n.d(t,"max",function(){return q.max});var G=n(183);n.d(t,"merge",function(){return G.merge});var H=n(116);n.d(t,"mergeAll",function(){return H.mergeAll});var Y=n(117);n.d(t,"mergeMap",function(){return Y.mergeMap}),n.d(t,"flatMap",function(){return Y.mergeMap});var J=n(184);n.d(t,"mergeMapTo",function(){return J.mergeMapTo});var K=n(185);n.d(t,"mergeScan",function(){return K.mergeScan});var X=n(186);n.d(t,"min",function(){return X.min});var Z=n(187);n.d(t,"multicast",function(){return Z.multicast});var Q=n(70);n.d(t,"observeOn",function(){return Q.observeOn});var ee=n(188);n.d(t,"onErrorResumeNext",function(){return ee.onErrorResumeNext});var te=n(189);n.d(t,"pairwise",function(){return te.pairwise});var ne=n(190);n.d(t,"partition",function(){return ne.partition});var re=n(192);n.d(t,"pluck",function(){return re.pluck});var ie=n(193);n.d(t,"publish",function(){return ie.publish});var oe=n(194);n.d(t,"publishBehavior",function(){return oe.publishBehavior});var se=n(195);n.d(t,"publishLast",function(){return se.publishLast});var ae=n(196);n.d(t,"publishReplay",function(){return ae.publishReplay});var ce=n(197);n.d(t,"race",function(){return ce.race});var ue=n(181);n.d(t,"reduce",function(){return ue.reduce});var de=n(198);n.d(t,"repeat",function(){return de.repeat});var le=n(199);n.d(t,"repeatWhen",function(){return le.repeatWhen});var fe=n(200);n.d(t,"retry",function(){return fe.retry});var pe=n(201);n.d(t,"retryWhen",function(){return pe.retryWhen});var he=n(59);n.d(t,"refCount",function(){return he.refCount});var me=n(202);n.d(t,"sample",function(){return me.sample});var ve=n(203);n.d(t,"sampleTime",function(){return ve.sampleTime});var be=n(182);n.d(t,"scan",function(){return be.scan});var ge=n(204);n.d(t,"sequenceEqual",function(){return ge.sequenceEqual});var _e=n(205);n.d(t,"share",function(){return _e.share});var ye=n(206);n.d(t,"shareReplay",function(){return ye.shareReplay});var Se=n(207);n.d(t,"single",function(){return Se.single});var we=n(208);n.d(t,"skip",function(){return we.skip});var xe=n(209);n.d(t,"skipLast",function(){return xe.skipLast});var Ce=n(210);n.d(t,"skipUntil",function(){return Ce.skipUntil});var Ee=n(211);n.d(t,"skipWhile",function(){return Ee.skipWhile});var Te=n(212);n.d(t,"startWith",function(){return Te.startWith});var Ie=n(213);n.d(t,"subscribeOn",function(){return Ie.subscribeOn});var Re=n(215);n.d(t,"switchAll",function(){return Re.switchAll});var ke=n(216);n.d(t,"switchMap",function(){return ke.switchMap});var Oe=n(217);n.d(t,"switchMapTo",function(){return Oe.switchMapTo});var Me=n(164);n.d(t,"take",function(){return Me.take});var Ae=n(177);n.d(t,"takeLast",function(){return Ae.takeLast});var Pe=n(218);n.d(t,"takeUntil",function(){return Pe.takeUntil});var je=n(219);n.d(t,"takeWhile",function(){return je.takeWhile});var Ne=n(163);n.d(t,"tap",function(){return Ne.tap});var De=n(220);n.d(t,"throttle",function(){return De.throttle});var Le=n(221);n.d(t,"throttleTime",function(){return Le.throttleTime});var Ve=n(162);n.d(t,"throwIfEmpty",function(){return Ve.throwIfEmpty});var Fe=n(222);n.d(t,"timeInterval",function(){return Fe.timeInterval});var Ue=n(223);n.d(t,"timeout",function(){return Ue.timeout});var We=n(224);n.d(t,"timeoutWith",function(){return We.timeoutWith});var Be=n(225);n.d(t,"timestamp",function(){return Be.timestamp});var ze=n(226);n.d(t,"toArray",function(){return ze.toArray});var $e=n(227);n.d(t,"window",function(){return $e.window});var qe=n(228);n.d(t,"windowCount",function(){return qe.windowCount});var Ge=n(229);n.d(t,"windowTime",function(){return Ge.windowTime});var He=n(230);n.d(t,"windowToggle",function(){return He.windowToggle});var Ye=n(231);n.d(t,"windowWhen",function(){return Ye.windowWhen});var Je=n(232);n.d(t,"withLatestFrom",function(){return Je.withLatestFrom});var Ke=n(233);n.d(t,"zip",function(){return Ke.zip});var Xe=n(234);n.d(t,"zipAll",function(){return Xe.zipAll})},function(e,t,n){"use strict";n.r(t),n.d(t,"audit",function(){return c});var r=n(40),i=n(48),o=n(49),s=n(98),a=n(99);function c(e){return function(t){return t.lift(new u(e))}}var u=function(){function e(e){this.durationSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new d(e,this.durationSelector))},e}(),d=function(e){function t(t,n){var r=e.call(this,t)||this;return r.durationSelector=n,r.hasValue=!1,r}return r.__extends(t,e),t.prototype._next=function(e){if(this.value=e,this.hasValue=!0,!this.throttled){var t=Object(i.tryCatch)(this.durationSelector)(e);if(t===o.errorObject)this.destination.error(o.errorObject.e);else{var n=Object(a.subscribeToResult)(this,t);!n||n.closed?this.clearThrottle():this.add(this.throttled=n)}}},t.prototype.clearThrottle=function(){var e=this.value,t=this.hasValue,n=this.throttled;n&&(this.remove(n),this.throttled=null,n.unsubscribe()),t&&(this.value=null,this.hasValue=!1,this.destination.next(e))},t.prototype.notifyNext=function(e,t,n,r){this.clearThrottle()},t.prototype.notifyComplete=function(){this.clearThrottle()},t}(s.OuterSubscriber)},function(e,t,n){"use strict";n.r(t),n.d(t,"auditTime",function(){return s});var r=n(84),i=n(136),o=n(132);function s(e,t){return void 0===t&&(t=r.async),Object(i.audit)(function(){return Object(o.timer)(e,t)})}},function(e,t,n){"use strict";n.r(t),n.d(t,"buffer",function(){return s});var r=n(40),i=n(98),o=n(99);function s(e){return function(t){return t.lift(new a(e))}}var a=function(){function e(e){this.closingNotifier=e}return e.prototype.call=function(e,t){return t.subscribe(new c(e,this.closingNotifier))},e}(),c=function(e){function t(t,n){var r=e.call(this,t)||this;return r.buffer=[],r.add(Object(o.subscribeToResult)(r,n)),r}return r.__extends(t,e),t.prototype._next=function(e){this.buffer.push(e)},t.prototype.notifyNext=function(e,t,n,r,i){var o=this.buffer;this.buffer=[],this.destination.next(o)},t}(i.OuterSubscriber)},function(e,t,n){"use strict";n.r(t),n.d(t,"bufferCount",function(){return o});var r=n(40),i=n(39);function o(e,t){return void 0===t&&(t=null),function(n){return n.lift(new s(e,t))}}var s=function(){function e(e,t){this.bufferSize=e,this.startBufferEvery=t,this.subscriberClass=t&&e!==t?c:a}return e.prototype.call=function(e,t){return t.subscribe(new this.subscriberClass(e,this.bufferSize,this.startBufferEvery))},e}(),a=function(e){function t(t,n){var r=e.call(this,t)||this;return r.bufferSize=n,r.buffer=[],r}return r.__extends(t,e),t.prototype._next=function(e){var t=this.buffer;t.push(e),t.length==this.bufferSize&&(this.destination.next(t),this.buffer=[])},t.prototype._complete=function(){var t=this.buffer;t.length>0&&this.destination.next(t),e.prototype._complete.call(this)},t}(i.Subscriber),c=function(e){function t(t,n,r){var i=e.call(this,t)||this;return i.bufferSize=n,i.startBufferEvery=r,i.buffers=[],i.count=0,i}return r.__extends(t,e),t.prototype._next=function(e){var t=this.bufferSize,n=this.startBufferEvery,r=this.buffers,i=this.count;this.count++,i%n==0&&r.push([]);for(var o=r.length;o--;){var s=r[o];s.push(e),s.length===t&&(r.splice(o,1),this.destination.next(s))}},t.prototype._complete=function(){for(var t=this.buffers,n=this.destination;t.length>0;){var r=t.shift();r.length>0&&n.next(r)}e.prototype._complete.call(this)},t}(i.Subscriber)},function(e,t,n){"use strict";n.r(t),n.d(t,"bufferTime",function(){return a});var r=n(40),i=n(84),o=n(39),s=n(74);function a(e){var t=arguments.length,n=i.async;Object(s.isScheduler)(arguments[arguments.length-1])&&(n=arguments[arguments.length-1],t--);var r=null;t>=2&&(r=arguments[1]);var o=Number.POSITIVE_INFINITY;return t>=3&&(o=arguments[2]),function(t){return t.lift(new c(e,r,o,n))}}var c=function(){function e(e,t,n,r){this.bufferTimeSpan=e,this.bufferCreationInterval=t,this.maxBufferSize=n,this.scheduler=r}return e.prototype.call=function(e,t){return t.subscribe(new d(e,this.bufferTimeSpan,this.bufferCreationInterval,this.maxBufferSize,this.scheduler))},e}(),u=function(){return function(){this.buffer=[]}}(),d=function(e){function t(t,n,r,i,o){var s=e.call(this,t)||this;s.bufferTimeSpan=n,s.bufferCreationInterval=r,s.maxBufferSize=i,s.scheduler=o,s.contexts=[];var a=s.openContext();if(s.timespanOnly=null==r||r<0,s.timespanOnly){var c={subscriber:s,context:a,bufferTimeSpan:n};s.add(a.closeAction=o.schedule(l,n,c))}else{var u={subscriber:s,context:a},d={bufferTimeSpan:n,bufferCreationInterval:r,subscriber:s,scheduler:o};s.add(a.closeAction=o.schedule(p,n,u)),s.add(o.schedule(f,r,d))}return s}return r.__extends(t,e),t.prototype._next=function(e){for(var t,n=this.contexts,r=n.length,i=0;i<r;i++){var o=n[i],s=o.buffer;s.push(e),s.length==this.maxBufferSize&&(t=o)}t&&this.onBufferFull(t)},t.prototype._error=function(t){this.contexts.length=0,e.prototype._error.call(this,t)},t.prototype._complete=function(){for(var t=this.contexts,n=this.destination;t.length>0;){var r=t.shift();n.next(r.buffer)}e.prototype._complete.call(this)},t.prototype._unsubscribe=function(){this.contexts=null},t.prototype.onBufferFull=function(e){this.closeContext(e);var t=e.closeAction;if(t.unsubscribe(),this.remove(t),!this.closed&&this.timespanOnly){e=this.openContext();var n=this.bufferTimeSpan,r={subscriber:this,context:e,bufferTimeSpan:n};this.add(e.closeAction=this.scheduler.schedule(l,n,r))}},t.prototype.openContext=function(){var e=new u;return this.contexts.push(e),e},t.prototype.closeContext=function(e){this.destination.next(e.buffer);var t=this.contexts;(t?t.indexOf(e):-1)>=0&&t.splice(t.indexOf(e),1)},t}(o.Subscriber);function l(e){var t=e.subscriber,n=e.context;n&&t.closeContext(n),t.closed||(e.context=t.openContext(),e.context.closeAction=this.schedule(e,e.bufferTimeSpan))}function f(e){var t=e.bufferCreationInterval,n=e.bufferTimeSpan,r=e.subscriber,i=e.scheduler,o=r.openContext();r.closed||(r.add(o.closeAction=i.schedule(p,n,{subscriber:r,context:o})),this.schedule(e,t))}function p(e){var t=e.subscriber,n=e.context;t.closeContext(n)}},function(e,t,n){"use strict";n.r(t),n.d(t,"bufferToggle",function(){return a});var r=n(40),i=n(45),o=n(99),s=n(98);function a(e,t){return function(n){return n.lift(new c(e,t))}}var c=function(){function e(e,t){this.openings=e,this.closingSelector=t}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.openings,this.closingSelector))},e}(),u=function(e){function t(t,n,r){var i=e.call(this,t)||this;return i.openings=n,i.closingSelector=r,i.contexts=[],i.add(Object(o.subscribeToResult)(i,n)),i}return r.__extends(t,e),t.prototype._next=function(e){for(var t=this.contexts,n=t.length,r=0;r<n;r++)t[r].buffer.push(e)},t.prototype._error=function(t){for(var n=this.contexts;n.length>0;){var r=n.shift();r.subscription.unsubscribe(),r.buffer=null,r.subscription=null}this.contexts=null,e.prototype._error.call(this,t)},t.prototype._complete=function(){for(var t=this.contexts;t.length>0;){var n=t.shift();this.destination.next(n.buffer),n.subscription.unsubscribe(),n.buffer=null,n.subscription=null}this.contexts=null,e.prototype._complete.call(this)},t.prototype.notifyNext=function(e,t,n,r,i){e?this.closeBuffer(e):this.openBuffer(t)},t.prototype.notifyComplete=function(e){this.closeBuffer(e.context)},t.prototype.openBuffer=function(e){try{var t=this.closingSelector.call(this,e);t&&this.trySubscribe(t)}catch(n){this._error(n)}},t.prototype.closeBuffer=function(e){var t=this.contexts;if(t&&e){var n=e.buffer,r=e.subscription;this.destination.next(n),t.splice(t.indexOf(e),1),this.remove(r),r.unsubscribe()}},t.prototype.trySubscribe=function(e){var t=this.contexts,n=new i.Subscription,r={buffer:[],subscription:n};t.push(r);var s=Object(o.subscribeToResult)(this,e,r);!s||s.closed?this.closeBuffer(r):(s.context=r,this.add(s),n.add(s))},t}(s.OuterSubscriber)},function(e,t,n){"use strict";n.r(t),n.d(t,"bufferWhen",function(){return u});var r=n(40),i=n(45),o=n(48),s=n(49),a=n(98),c=n(99);function u(e){return function(t){return t.lift(new d(e))}}var d=function(){function e(e){this.closingSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.closingSelector))},e}(),l=function(e){function t(t,n){var r=e.call(this,t)||this;return r.closingSelector=n,r.subscribing=!1,r.openBuffer(),r}return r.__extends(t,e),t.prototype._next=function(e){this.buffer.push(e)},t.prototype._complete=function(){var t=this.buffer;t&&this.destination.next(t),e.prototype._complete.call(this)},t.prototype._unsubscribe=function(){this.buffer=null,this.subscribing=!1},t.prototype.notifyNext=function(e,t,n,r,i){this.openBuffer()},t.prototype.notifyComplete=function(){this.subscribing?this.complete():this.openBuffer()},t.prototype.openBuffer=function(){var e=this.closingSubscription;e&&(this.remove(e),e.unsubscribe());var t=this.buffer;this.buffer&&this.destination.next(t),this.buffer=[];var n=Object(o.tryCatch)(this.closingSelector)();n===s.errorObject?this.error(s.errorObject.e):(e=new i.Subscription,this.closingSubscription=e,this.add(e),this.subscribing=!0,e.add(Object(c.subscribeToResult)(this,n)),this.subscribing=!1)},t}(a.OuterSubscriber)},function(e,t,n){"use strict";n.r(t),n.d(t,"catchError",function(){return s});var r=n(40),i=n(98),o=n(99);function s(e){return function(t){var n=new a(e),r=t.lift(n);return n.caught=r}}var a=function(){function e(e){this.selector=e}return e.prototype.call=function(e,t){return t.subscribe(new c(e,this.selector,this.caught))},e}(),c=function(e){function t(t,n,r){var i=e.call(this,t)||this;return i.selector=n,i.caught=r,i}return r.__extends(t,e),t.prototype.error=function(t){if(!this.isStopped){var n=void 0;try{n=this.selector(t,this.caught)}catch(r){return void e.prototype.error.call(this,r)}this._unsubscribeAndRecycle(),this.add(Object(o.subscribeToResult)(this,n))}},t}(i.OuterSubscriber)},function(e,t,n){"use strict";n.r(t),n.d(t,"combineAll",function(){return i});var r=n(97);function i(e){return function(t){return t.lift(new r.CombineLatestOperator(e))}}},function(e,t,n){"use strict";n.r(t),n.d(t,"combineLatest",function(){return s});var r=n(46),i=n(97),o=n(109);function s(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=null;return"function"==typeof e[e.length-1]&&(n=e.pop()),1===e.length&&Object(r.isArray)(e[0])&&(e=e[0].slice()),function(t){return t.lift.call(Object(o.from)([t].concat(e)),new i.CombineLatestOperator(n))}}},function(e,t,n){"use strict";n.r(t),n.d(t,"concat",function(){return i});var r=n(108);function i(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return t.lift.call(r.concat.apply(void 0,[t].concat(e)))}}},function(e,t,n){"use strict";n.r(t),n.d(t,"concatMap",function(){return i});var r=n(117);function i(e,t){return Object(r.mergeMap)(e,t,1)}},function(e,t,n){"use strict";n.r(t),n.d(t,"concatMapTo",function(){return i});var r=n(147);function i(e,t){return Object(r.concatMap)(function(){return e},t)}},function(e,t,n){"use strict";n.r(t),n.d(t,"count",function(){return o});var r=n(40),i=n(39);function o(e){return function(t){return t.lift(new s(e,t))}}var s=function(){function e(e,t){this.predicate=e,this.source=t}return e.prototype.call=function(e,t){return t.subscribe(new a(e,this.predicate,this.source))},e}(),a=function(e){function t(t,n,r){var i=e.call(this,t)||this;return i.predicate=n,i.source=r,i.count=0,i.index=0,i}return r.__extends(t,e),t.prototype._next=function(e){this.predicate?this._tryPredicate(e):this.count++},t.prototype._tryPredicate=function(e){var t;try{t=this.predicate(e,this.index++,this.source)}catch(n){return void this.destination.error(n)}t&&this.count++},t.prototype._complete=function(){this.destination.next(this.count),this.destination.complete()},t}(i.Subscriber)},function(e,t,n){"use strict";n.r(t),n.d(t,"debounce",function(){return s});var r=n(40),i=n(98),o=n(99);function s(e){return function(t){return t.lift(new a(e))}}var a=function(){function e(e){this.durationSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new c(e,this.durationSelector))},e}(),c=function(e){function t(t,n){var r=e.call(this,t)||this;return r.durationSelector=n,r.hasValue=!1,r.durationSubscription=null,r}return r.__extends(t,e),t.prototype._next=function(e){try{var t=this.durationSelector.call(this,e);t&&this._tryNext(e,t)}catch(n){this.destination.error(n)}},t.prototype._complete=function(){this.emitValue(),this.destination.complete()},t.prototype._tryNext=function(e,t){var n=this.durationSubscription;this.value=e,this.hasValue=!0,n&&(n.unsubscribe(),this.remove(n)),(n=Object(o.subscribeToResult)(this,t))&&!n.closed&&this.add(this.durationSubscription=n)},t.prototype.notifyNext=function(e,t,n,r,i){this.emitValue()},t.prototype.notifyComplete=function(){this.emitValue()},t.prototype.emitValue=function(){if(this.hasValue){var t=this.value,n=this.durationSubscription;n&&(this.durationSubscription=null,n.unsubscribe(),this.remove(n)),this.value=null,this.hasValue=!1,e.prototype._next.call(this,t)}},t}(i.OuterSubscriber)},function(e,t,n){"use strict";n.r(t),n.d(t,"debounceTime",function(){return s});var r=n(40),i=n(39),o=n(84);function s(e,t){return void 0===t&&(t=o.async),function(n){return n.lift(new a(e,t))}}var a=function(){function e(e,t){this.dueTime=e,this.scheduler=t}return e.prototype.call=function(e,t){return t.subscribe(new c(e,this.dueTime,this.scheduler))},e}(),c=function(e){function t(t,n,r){var i=e.call(this,t)||this;return i.dueTime=n,i.scheduler=r,i.debouncedSubscription=null,i.lastValue=null,i.hasValue=!1,i}return r.__extends(t,e),t.prototype._next=function(e){this.clearDebounce(),this.lastValue=e,this.hasValue=!0,this.add(this.debouncedSubscription=this.scheduler.schedule(u,this.dueTime,this))},t.prototype._complete=function(){this.debouncedNext(),this.destination.complete()},t.prototype.debouncedNext=function(){if(this.clearDebounce(),this.hasValue){var e=this.lastValue;this.lastValue=null,this.hasValue=!1,this.destination.next(e)}},t.prototype.clearDebounce=function(){var e=this.debouncedSubscription;null!==e&&(this.remove(e),e.unsubscribe(),this.debouncedSubscription=null)},t}(i.Subscriber);function u(e){e.debouncedNext()}},function(e,t,n){"use strict";n.r(t),n.d(t,"defaultIfEmpty",function(){return o});var r=n(40),i=n(39);function o(e){return void 0===e&&(e=null),function(t){return t.lift(new s(e))}}var s=function(){function e(e){this.defaultValue=e}return e.prototype.call=function(e,t){return t.subscribe(new a(e,this.defaultValue))},e}(),a=function(e){function t(t,n){var r=e.call(this,t)||this;return r.defaultValue=n,r.isEmpty=!0,r}return r.__extends(t,e),t.prototype._next=function(e){this.isEmpty=!1,this.destination.next(e)},t.prototype._complete=function(){this.isEmpty&&this.destination.next(this.defaultValue),this.destination.complete()},t}(i.Subscriber)},function(e,t,n){"use strict";n.r(t),n.d(t,"delay",function(){return c});var r=n(40),i=n(84),o=n(154),s=n(39),a=n(71);function c(e,t){void 0===t&&(t=i.async);var n=Object(o.isDate)(e)?+e-t.now():Math.abs(e);return function(e){return e.lift(new u(n,t))}}var u=function(){function e(e,t){this.delay=e,this.scheduler=t}return e.prototype.call=function(e,t){return t.subscribe(new d(e,this.delay,this.scheduler))},e}(),d=function(e){function t(t,n,r){var i=e.call(this,t)||this;return i.delay=n,i.scheduler=r,i.queue=[],i.active=!1,i.errored=!1,i}return r.__extends(t,e),t.dispatch=function(e){for(var t=e.source,n=t.queue,r=e.scheduler,i=e.destination;n.length>0&&n[0].time-r.now()<=0;)n.shift().notification.observe(i);if(n.length>0){var o=Math.max(0,n[0].time-r.now());this.schedule(e,o)}else this.unsubscribe(),t.active=!1},t.prototype._schedule=function(e){this.active=!0,this.add(e.schedule(t.dispatch,this.delay,{source:this,destination:this.destination,scheduler:e}))},t.prototype.scheduleNotification=function(e){if(!0!==this.errored){var t=this.scheduler,n=new l(t.now()+this.delay,e);this.queue.push(n),!1===this.active&&this._schedule(t)}},t.prototype._next=function(e){this.scheduleNotification(a.Notification.createNext(e))},t.prototype._error=function(e){this.errored=!0,this.queue=[],this.destination.error(e)},t.prototype._complete=function(){this.scheduleNotification(a.Notification.createComplete())},t}(s.Subscriber),l=function(){return function(e,t){this.time=e,this.notification=t}}()},function(e,t,n){"use strict";function r(e){return e instanceof Date&&!isNaN(+e)}n.r(t),n.d(t,"isDate",function(){return r})},function(e,t,n){"use strict";n.r(t),n.d(t,"delayWhen",function(){return c});var r=n(40),i=n(39),o=n(37),s=n(98),a=n(99);function c(e,t){return t?function(n){return new l(n,t).lift(new u(e))}:function(t){return t.lift(new u(e))}}var u=function(){function e(e){this.delayDurationSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new d(e,this.delayDurationSelector))},e}(),d=function(e){function t(t,n){var r=e.call(this,t)||this;return r.delayDurationSelector=n,r.completed=!1,r.delayNotifierSubscriptions=[],r}return r.__extends(t,e),t.prototype.notifyNext=function(e,t,n,r,i){this.destination.next(e),this.removeSubscription(i),this.tryComplete()},t.prototype.notifyError=function(e,t){this._error(e)},t.prototype.notifyComplete=function(e){var t=this.removeSubscription(e);t&&this.destination.next(t),this.tryComplete()},t.prototype._next=function(e){try{var t=this.delayDurationSelector(e);t&&this.tryDelay(t,e)}catch(n){this.destination.error(n)}},t.prototype._complete=function(){this.completed=!0,this.tryComplete()},t.prototype.removeSubscription=function(e){e.unsubscribe();var t=this.delayNotifierSubscriptions.indexOf(e);return-1!==t&&this.delayNotifierSubscriptions.splice(t,1),e.outerValue},t.prototype.tryDelay=function(e,t){var n=Object(a.subscribeToResult)(this,e,t);n&&!n.closed&&(this.add(n),this.delayNotifierSubscriptions.push(n))},t.prototype.tryComplete=function(){this.completed&&0===this.delayNotifierSubscriptions.length&&this.destination.complete()},t}(s.OuterSubscriber),l=function(e){function t(t,n){var r=e.call(this)||this;return r.source=t,r.subscriptionDelay=n,r}return r.__extends(t,e),t.prototype._subscribe=function(e){this.subscriptionDelay.subscribe(new f(e,this.source))},t}(o.Observable),f=function(e){function t(t,n){var r=e.call(this)||this;return r.parent=t,r.source=n,r.sourceSubscribed=!1,r}return r.__extends(t,e),t.prototype._next=function(e){this.subscribeToSource()},t.prototype._error=function(e){this.unsubscribe(),this.parent.error(e)},t.prototype._complete=function(){this.subscribeToSource()},t.prototype.subscribeToSource=function(){this.sourceSubscribed||(this.sourceSubscribed=!0,this.unsubscribe(),this.source.subscribe(this.parent))},t}(i.Subscriber)},function(e,t,n){"use strict";n.r(t),n.d(t,"dematerialize",function(){return o});var r=n(40),i=n(39);function o(){return function(e){return e.lift(new s)}}var s=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new a(e))},e}(),a=function(e){function t(t){return e.call(this,t)||this}return r.__extends(t,e),t.prototype._next=function(e){e.observe(this.destination)},t}(i.Subscriber)},function(e,t,n){"use strict";n.r(t),n.d(t,"distinct",function(){return s}),n.d(t,"DistinctSubscriber",function(){return c});var r=n(40),i=n(98),o=n(99);function s(e,t){return function(n){return n.lift(new a(e,t))}}var a=function(){function e(e,t){this.keySelector=e,this.flushes=t}return e.prototype.call=function(e,t){return t.subscribe(new c(e,this.keySelector,this.flushes))},e}(),c=function(e){function t(t,n,r){var i=e.call(this,t)||this;return i.keySelector=n,i.values=new Set,r&&i.add(Object(o.subscribeToResult)(i,r)),i}return r.__extends(t,e),t.prototype.notifyNext=function(e,t,n,r,i){this.values.clear()},t.prototype.notifyError=function(e,t){this._error(e)},t.prototype._next=function(e){this.keySelector?this._useKeySelector(e):this._finalizeNext(e,e)},t.prototype._useKeySelector=function(e){var t,n=this.destination;try{t=this.keySelector(e)}catch(r){return void n.error(r)}this._finalizeNext(t,e)},t.prototype._finalizeNext=function(e,t){var n=this.values;n.has(e)||(n.add(e),this.destination.next(t))},t}(i.OuterSubscriber)},function(e,t,n){"use strict";n.r(t),n.d(t,"distinctUntilChanged",function(){return a});var r=n(40),i=n(39),o=n(48),s=n(49);function a(e,t){return function(n){return n.lift(new c(e,t))}}var c=function(){function e(e,t){this.compare=e,this.keySelector=t}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.compare,this.keySelector))},e}(),u=function(e){function t(t,n,r){var i=e.call(this,t)||this;return i.keySelector=r,i.hasKey=!1,"function"==typeof n&&(i.compare=n),i}return r.__extends(t,e),t.prototype.compare=function(e,t){return e===t},t.prototype._next=function(e){var t=e;if(this.keySelector&&(t=Object(o.tryCatch)(this.keySelector)(e))===s.errorObject)return this.destination.error(s.errorObject.e);var n=!1;if(this.hasKey){if((n=Object(o.tryCatch)(this.compare)(this.key,t))===s.errorObject)return this.destination.error(s.errorObject.e)}else this.hasKey=!0;!1===Boolean(n)&&(this.key=t,this.destination.next(e))},t}(i.Subscriber)},function(e,t,n){"use strict";n.r(t),n.d(t,"distinctUntilKeyChanged",function(){return i});var r=n(158);function i(e,t){return Object(r.distinctUntilChanged)(function(n,r){return t?t(n[e],r[e]):n[e]===r[e]})}},function(e,t,n){"use strict";n.r(t),n.d(t,"elementAt",function(){return c});var r=n(91),i=n(161),o=n(162),s=n(152),a=n(164);function c(e,t){if(e<0)throw new r.ArgumentOutOfRangeError;var n=arguments.length>=2;return function(c){return c.pipe(Object(i.filter)(function(t,n){return n===e}),Object(a.take)(1),n?Object(s.defaultIfEmpty)(t):Object(o.throwIfEmpty)(function(){return new r.ArgumentOutOfRangeError}))}}},function(e,t,n){"use strict";n.r(t),n.d(t,"filter",function(){return o});var r=n(40),i=n(39);function o(e,t){return function(n){return n.lift(new s(e,t))}}var s=function(){function e(e,t){this.predicate=e,this.thisArg=t}return e.prototype.call=function(e,t){return t.subscribe(new a(e,this.predicate,this.thisArg))},e}(),a=function(e){function t(t,n,r){var i=e.call(this,t)||this;return i.predicate=n,i.thisArg=r,i.count=0,i}return r.__extends(t,e),t.prototype._next=function(e){var t;try{t=this.predicate.call(this.thisArg,e,this.count++)}catch(n){return void this.destination.error(n)}t&&this.destination.next(e)},t}(i.Subscriber)},function(e,t,n){"use strict";n.r(t),n.d(t,"throwIfEmpty",function(){return o});var r=n(163),i=n(92),o=function(e){return void 0===e&&(e=s),Object(r.tap)({hasValue:!1,next:function(){this.hasValue=!0},complete:function(){if(!this.hasValue)throw e()}})};function s(){return new i.EmptyError}},function(e,t,n){"use strict";n.r(t),n.d(t,"tap",function(){return a});var r=n(40),i=n(39),o=n(54),s=n(41);function a(e,t,n){return function(r){return r.lift(new c(e,t,n))}}var c=function(){function e(e,t,n){this.nextOrObserver=e,this.error=t,this.complete=n}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.nextOrObserver,this.error,this.complete))},e}(),u=function(e){function t(t,n,r,i){var a=e.call(this,t)||this;return a._tapNext=o.noop,a._tapError=o.noop,a._tapComplete=o.noop,a._tapError=r||o.noop,a._tapComplete=i||o.noop,Object(s.isFunction)(n)?(a._context=a,a._tapNext=n):n&&(a._context=n,a._tapNext=n.next||o.noop,a._tapError=n.error||o.noop,a._tapComplete=n.complete||o.noop),a}return r.__extends(t,e),t.prototype._next=function(e){try{this._tapNext.call(this._context,e)}catch(t){return void this.destination.error(t)}this.destination.next(e)},t.prototype._error=function(e){try{this._tapError.call(this._context,e)}catch(e){return void this.destination.error(e)}this.destination.error(e)},t.prototype._complete=function(){try{this._tapComplete.call(this._context)}catch(e){return void this.destination.error(e)}return this.destination.complete()},t}(i.Subscriber)},function(e,t,n){"use strict";n.r(t),n.d(t,"take",function(){return a});var r=n(40),i=n(39),o=n(91),s=n(72);function a(e){return function(t){return 0===e?Object(s.empty)():t.lift(new c(e))}}var c=function(){function e(e){if(this.total=e,this.total<0)throw new o.ArgumentOutOfRangeError}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.total))},e}(),u=function(e){function t(t,n){var r=e.call(this,t)||this;return r.total=n,r.count=0,r}return r.__extends(t,e),t.prototype._next=function(e){var t=this.total,n=++this.count;n<=t&&(this.destination.next(e),n===t&&(this.destination.complete(),this.unsubscribe()))},t}(i.Subscriber)},function(e,t,n){"use strict";n.r(t),n.d(t,"endWith",function(){return c});var r=n(75),i=n(77),o=n(72),s=n(108),a=n(74);function c(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){var n=e[e.length-1];Object(a.isScheduler)(n)?e.pop():n=null;var c=e.length;return 1!==c||n?c>0?Object(s.concat)(t,Object(r.fromArray)(e,n)):Object(s.concat)(t,Object(o.empty)(n)):Object(s.concat)(t,Object(i.scalar)(e[0]))}}},function(e,t,n){"use strict";n.r(t),n.d(t,"every",function(){return o});var r=n(40),i=n(39);function o(e,t){return function(n){return n.lift(new s(e,t,n))}}var s=function(){function e(e,t,n){this.predicate=e,this.thisArg=t,this.source=n}return e.prototype.call=function(e,t){return t.subscribe(new a(e,this.predicate,this.thisArg,this.source))},e}(),a=function(e){function t(t,n,r,i){var o=e.call(this,t)||this;return o.predicate=n,o.thisArg=r,o.source=i,o.index=0,o.thisArg=r||o,o}return r.__extends(t,e),t.prototype.notifyComplete=function(e){this.destination.next(e),this.destination.complete()},t.prototype._next=function(e){var t=!1;try{t=this.predicate.call(this.thisArg,e,this.index++,this.source)}catch(n){return void this.destination.error(n)}t||this.notifyComplete(!1)},t.prototype._complete=function(){this.notifyComplete(!0)},t}(i.Subscriber)},function(e,t,n){"use strict";n.r(t),n.d(t,"exhaust",function(){return s});var r=n(40),i=n(98),o=n(99);function s(){return function(e){return e.lift(new a)}}var a=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new c(e))},e}(),c=function(e){function t(t){var n=e.call(this,t)||this;return n.hasCompleted=!1,n.hasSubscription=!1,n}return r.__extends(t,e),t.prototype._next=function(e){this.hasSubscription||(this.hasSubscription=!0,this.add(Object(o.subscribeToResult)(this,e)))},t.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete()},t.prototype.notifyComplete=function(e){this.remove(e),this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},t}(i.OuterSubscriber)},function(e,t,n){"use strict";n.r(t),n.d(t,"exhaustMap",function(){return c});var r=n(40),i=n(98),o=n(99),s=n(95),a=n(109);function c(e,t){return t?function(n){return n.pipe(c(function(n,r){return Object(a.from)(e(n,r)).pipe(Object(s.map)(function(e,i){return t(n,e,r,i)}))}))}:function(t){return t.lift(new u(e))}}var u=function(){function e(e){this.project=e}return e.prototype.call=function(e,t){return t.subscribe(new d(e,this.project))},e}(),d=function(e){function t(t,n){var r=e.call(this,t)||this;return r.project=n,r.hasSubscription=!1,r.hasCompleted=!1,r.index=0,r}return r.__extends(t,e),t.prototype._next=function(e){this.hasSubscription||this.tryNext(e)},t.prototype.tryNext=function(e){var t=this.index++,n=this.destination;try{var r=this.project(e,t);this.hasSubscription=!0,this.add(Object(o.subscribeToResult)(this,r,e,t))}catch(i){n.error(i)}},t.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete()},t.prototype.notifyNext=function(e,t,n,r,i){this.destination.next(t)},t.prototype.notifyError=function(e){this.destination.error(e)},t.prototype.notifyComplete=function(e){this.remove(e),this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},t}(i.OuterSubscriber)},function(e,t,n){"use strict";n.r(t),n.d(t,"expand",function(){return c}),n.d(t,"ExpandOperator",function(){return u}),n.d(t,"ExpandSubscriber",function(){return d});var r=n(40),i=n(48),o=n(49),s=n(98),a=n(99);function c(e,t,n){return void 0===t&&(t=Number.POSITIVE_INFINITY),void 0===n&&(n=void 0),t=(t||0)<1?Number.POSITIVE_INFINITY:t,function(r){return r.lift(new u(e,t,n))}}var u=function(){function e(e,t,n){this.project=e,this.concurrent=t,this.scheduler=n}return e.prototype.call=function(e,t){return t.subscribe(new d(e,this.project,this.concurrent,this.scheduler))},e}(),d=function(e){function t(t,n,r,i){var o=e.call(this,t)||this;return o.project=n,o.concurrent=r,o.scheduler=i,o.index=0,o.active=0,o.hasCompleted=!1,r<Number.POSITIVE_INFINITY&&(o.buffer=[]),o}return r.__extends(t,e),t.dispatch=function(e){var t=e.subscriber,n=e.result,r=e.value,i=e.index;t.subscribeToProjection(n,r,i)},t.prototype._next=function(e){var n=this.destination;if(n.closed)this._complete();else{var r=this.index++;if(this.active<this.concurrent){n.next(e);var s=Object(i.tryCatch)(this.project)(e,r);if(s===o.errorObject)n.error(o.errorObject.e);else if(this.scheduler){var a={subscriber:this,result:s,value:e,index:r};this.add(this.scheduler.schedule(t.dispatch,0,a))}else this.subscribeToProjection(s,e,r)}else this.buffer.push(e)}},t.prototype.subscribeToProjection=function(e,t,n){this.active++,this.add(Object(a.subscribeToResult)(this,e,t,n))},t.prototype._complete=function(){this.hasCompleted=!0,this.hasCompleted&&0===this.active&&this.destination.complete()},t.prototype.notifyNext=function(e,t,n,r,i){this._next(t)},t.prototype.notifyComplete=function(e){var t=this.buffer;this.remove(e),this.active--,t&&t.length>0&&this._next(t.shift()),this.hasCompleted&&0===this.active&&this.destination.complete()},t}(s.OuterSubscriber)},function(e,t,n){"use strict";n.r(t),n.d(t,"finalize",function(){return s});var r=n(40),i=n(39),o=n(45);function s(e){return function(t){return t.lift(new a(e))}}var a=function(){function e(e){this.callback=e}return e.prototype.call=function(e,t){return t.subscribe(new c(e,this.callback))},e}(),c=function(e){function t(t,n){var r=e.call(this,t)||this;return r.add(new o.Subscription(n)),r}return r.__extends(t,e),t}(i.Subscriber)},function(e,t,n){"use strict";n.r(t),n.d(t,"find",function(){return o}),n.d(t,"FindValueOperator",function(){return s}),n.d(t,"FindValueSubscriber",function(){return a});var r=n(40),i=n(39);function o(e,t){if("function"!=typeof e)throw new TypeError("predicate is not a function");return function(n){return n.lift(new s(e,n,!1,t))}}var s=function(){function e(e,t,n,r){this.predicate=e,this.source=t,this.yieldIndex=n,this.thisArg=r}return e.prototype.call=function(e,t){return t.subscribe(new a(e,this.predicate,this.source,this.yieldIndex,this.thisArg))},e}(),a=function(e){function t(t,n,r,i,o){var s=e.call(this,t)||this;return s.predicate=n,s.source=r,s.yieldIndex=i,s.thisArg=o,s.index=0,s}return r.__extends(t,e),t.prototype.notifyComplete=function(e){var t=this.destination;t.next(e),t.complete()},t.prototype._next=function(e){var t=this.predicate,n=this.thisArg,r=this.index++;try{t.call(n||this,e,r,this.source)&&this.notifyComplete(this.yieldIndex?r:e)}catch(i){this.destination.error(i)}},t.prototype._complete=function(){this.notifyComplete(this.yieldIndex?-1:void 0)},t}(i.Subscriber)},function(e,t,n){"use strict";n.r(t),n.d(t,"findIndex",function(){return i});var r=n(171);function i(e,t){return function(n){return n.lift(new r.FindValueOperator(e,n,!0,t))}}},function(e,t,n){"use strict";n.r(t),n.d(t,"first",function(){return u});var r=n(92),i=n(161),o=n(164),s=n(152),a=n(162),c=n(89);function u(e,t){var n=arguments.length>=2;return function(u){return u.pipe(e?Object(i.filter)(function(t,n){return e(t,n,u)}):c.identity,Object(o.take)(1),n?Object(s.defaultIfEmpty)(t):Object(a.throwIfEmpty)(function(){return new r.EmptyError}))}}},function(e,t,n){"use strict";n.r(t),n.d(t,"ignoreElements",function(){return o});var r=n(40),i=n(39);function o(){return function(e){return e.lift(new s)}}var s=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new a(e))},e}(),a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype._next=function(e){},t}(i.Subscriber)},function(e,t,n){"use strict";n.r(t),n.d(t,"isEmpty",function(){return o});var r=n(40),i=n(39);function o(){return function(e){return e.lift(new s)}}var s=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new a(e))},e}(),a=function(e){function t(t){return e.call(this,t)||this}return r.__extends(t,e),t.prototype.notifyComplete=function(e){var t=this.destination;t.next(e),t.complete()},t.prototype._next=function(e){this.notifyComplete(!1)},t.prototype._complete=function(){this.notifyComplete(!0)},t}(i.Subscriber)},function(e,t,n){"use strict";n.r(t),n.d(t,"last",function(){return u});var r=n(92),i=n(161),o=n(177),s=n(162),a=n(152),c=n(89);function u(e,t){var n=arguments.length>=2;return function(u){return u.pipe(e?Object(i.filter)(function(t,n){return e(t,n,u)}):c.identity,Object(o.takeLast)(1),n?Object(a.defaultIfEmpty)(t):Object(s.throwIfEmpty)(function(){return new r.EmptyError}))}}},function(e,t,n){"use strict";n.r(t),n.d(t,"takeLast",function(){return a});var r=n(40),i=n(39),o=n(91),s=n(72);function a(e){return function(t){return 0===e?Object(s.empty)():t.lift(new c(e))}}var c=function(){function e(e){if(this.total=e,this.total<0)throw new o.ArgumentOutOfRangeError}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.total))},e}(),u=function(e){function t(t,n){var r=e.call(this,t)||this;return r.total=n,r.ring=new Array,r.count=0,r}return r.__extends(t,e),t.prototype._next=function(e){var t=this.ring,n=this.total,r=this.count++;t.length<n?t.push(e):t[r%n]=e},t.prototype._complete=function(){var e=this.destination,t=this.count;if(t>0)for(var n=this.count>=this.total?this.total:this.count,r=this.ring,i=0;i<n;i++){var o=t++%n;e.next(r[o])}e.complete()},t}(i.Subscriber)},function(e,t,n){"use strict";n.r(t),n.d(t,"mapTo",function(){return o});var r=n(40),i=n(39);function o(e){return function(t){return t.lift(new s(e))}}var s=function(){function e(e){this.value=e}return e.prototype.call=function(e,t){return t.subscribe(new a(e,this.value))},e}(),a=function(e){function t(t,n){var r=e.call(this,t)||this;return r.value=n,r}return r.__extends(t,e),t.prototype._next=function(e){this.destination.next(this.value)},t}(i.Subscriber)},function(e,t,n){"use strict";n.r(t),n.d(t,"materialize",function(){return s});var r=n(40),i=n(39),o=n(71);function s(){return function(e){return e.lift(new a)}}var a=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new c(e))},e}(),c=function(e){function t(t){return e.call(this,t)||this}return r.__extends(t,e),t.prototype._next=function(e){this.destination.next(o.Notification.createNext(e))},t.prototype._error=function(e){var t=this.destination;t.next(o.Notification.createError(e)),t.complete()},t.prototype._complete=function(){var e=this.destination;e.next(o.Notification.createComplete()),e.complete()},t}(i.Subscriber)},function(e,t,n){"use strict";n.r(t),n.d(t,"max",function(){return i});var r=n(181);function i(e){var t="function"==typeof e?function(t,n){return e(t,n)>0?t:n}:function(e,t){return e>t?e:t};return Object(r.reduce)(t)}},function(e,t,n){"use strict";n.r(t),n.d(t,"reduce",function(){return a});var r=n(182),i=n(177),o=n(152),s=n(53);function a(e,t){return arguments.length>=2?function(n){return Object(s.pipe)(Object(r.scan)(e,t),Object(i.takeLast)(1),Object(o.defaultIfEmpty)(t))(n)}:function(t){return Object(s.pipe)(Object(r.scan)(function(t,n,r){return e(t,n,r+1)}),Object(i.takeLast)(1))(t)}}},function(e,t,n){"use strict";n.r(t),n.d(t,"scan",function(){return o});var r=n(40),i=n(39);function o(e,t){var n=!1;return arguments.length>=2&&(n=!0),function(r){return r.lift(new s(e,t,n))}}var s=function(){function e(e,t,n){void 0===n&&(n=!1),this.accumulator=e,this.seed=t,this.hasSeed=n}return e.prototype.call=function(e,t){return t.subscribe(new a(e,this.accumulator,this.seed,this.hasSeed))},e}(),a=function(e){function t(t,n,r,i){var o=e.call(this,t)||this;return o.accumulator=n,o._seed=r,o.hasSeed=i,o.index=0,o}return r.__extends(t,e),Object.defineProperty(t.prototype,"seed",{get:function(){return this._seed},set:function(e){this.hasSeed=!0,this._seed=e},enumerable:!0,configurable:!0}),t.prototype._next=function(e){if(this.hasSeed)return this._tryNext(e);this.seed=e,this.destination.next(e)},t.prototype._tryNext=function(e){var t,n=this.index++;try{t=this.accumulator(this.seed,e,n)}catch(r){this.destination.error(r)}this.seed=t,this.destination.next(t)},t}(i.Subscriber)},function(e,t,n){"use strict";n.r(t),n.d(t,"merge",function(){return i});var r=n(126);function i(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return t.lift.call(r.merge.apply(void 0,[t].concat(e)))}}},function(e,t,n){"use strict";n.r(t),n.d(t,"mergeMapTo",function(){return i});var r=n(117);function i(e,t,n){return void 0===n&&(n=Number.POSITIVE_INFINITY),"function"==typeof t?Object(r.mergeMap)(function(){return e},t,n):("number"==typeof t&&(n=t),Object(r.mergeMap)(function(){return e},n))}},function(e,t,n){"use strict";n.r(t),n.d(t,"mergeScan",function(){return c}),n.d(t,"MergeScanOperator",function(){return u}),n.d(t,"MergeScanSubscriber",function(){return d});var r=n(40),i=n(48),o=n(49),s=n(99),a=n(98);function c(e,t,n){return void 0===n&&(n=Number.POSITIVE_INFINITY),function(r){return r.lift(new u(e,t,n))}}var u=function(){function e(e,t,n){this.accumulator=e,this.seed=t,this.concurrent=n}return e.prototype.call=function(e,t){return t.subscribe(new d(e,this.accumulator,this.seed,this.concurrent))},e}(),d=function(e){function t(t,n,r,i){var o=e.call(this,t)||this;return o.accumulator=n,o.acc=r,o.concurrent=i,o.hasValue=!1,o.hasCompleted=!1,o.buffer=[],o.active=0,o.index=0,o}return r.__extends(t,e),t.prototype._next=function(e){if(this.active<this.concurrent){var t=this.index++,n=Object(i.tryCatch)(this.accumulator)(this.acc,e),r=this.destination;n===o.errorObject?r.error(o.errorObject.e):(this.active++,this._innerSub(n,e,t))}else this.buffer.push(e)},t.prototype._innerSub=function(e,t,n){this.add(Object(s.subscribeToResult)(this,e,t,n))},t.prototype._complete=function(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&(!1===this.hasValue&&this.destination.next(this.acc),this.destination.complete())},t.prototype.notifyNext=function(e,t,n,r,i){var o=this.destination;this.acc=t,this.hasValue=!0,o.next(t)},t.prototype.notifyComplete=function(e){var t=this.buffer;this.remove(e),this.active--,t.length>0?this._next(t.shift()):0===this.active&&this.hasCompleted&&(!1===this.hasValue&&this.destination.next(this.acc),this.destination.complete())},t}(a.OuterSubscriber)},function(e,t,n){"use strict";n.r(t),n.d(t,"min",function(){return i});var r=n(181);function i(e){var t="function"==typeof e?function(t,n){return e(t,n)<0?t:n}:function(e,t){return e<t?e:t};return Object(r.reduce)(t)}},function(e,t,n){"use strict";n.r(t),n.d(t,"multicast",function(){return i}),n.d(t,"MulticastOperator",function(){return o});var r=n(55);function i(e,t){return function(n){var i;if(i="function"==typeof e?e:function(){return e},"function"==typeof t)return n.lift(new o(i,t));var s=Object.create(n,r.connectableObservableDescriptor);return s.source=n,s.subjectFactory=i,s}}var o=function(){function e(e,t){this.subjectFactory=e,this.selector=t}return e.prototype.call=function(e,t){var n=this.selector,r=this.subjectFactory(),i=n(r).subscribe(e);return i.add(t.subscribe(r)),i},e}()},function(e,t,n){"use strict";n.r(t),n.d(t,"onErrorResumeNext",function(){return c}),n.d(t,"onErrorResumeNextStatic",function(){return u});var r=n(40),i=n(109),o=n(46),s=n(98),a=n(99);function c(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 1===e.length&&Object(o.isArray)(e[0])&&(e=e[0]),function(t){return t.lift(new d(e))}}function u(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n;return 1===e.length&&Object(o.isArray)(e[0])&&(e=e[0]),n=e.shift(),Object(i.from)(n,null).lift(new d(e))}var d=function(){function e(e){this.nextSources=e}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.nextSources))},e}(),l=function(e){function t(t,n){var r=e.call(this,t)||this;return r.destination=t,r.nextSources=n,r}return r.__extends(t,e),t.prototype.notifyError=function(e,t){this.subscribeToNextSource()},t.prototype.notifyComplete=function(e){this.subscribeToNextSource()},t.prototype._error=function(e){this.subscribeToNextSource()},t.prototype._complete=function(){this.subscribeToNextSource()},t.prototype.subscribeToNextSource=function(){var e=this.nextSources.shift();e?this.add(Object(a.subscribeToResult)(this,e)):this.destination.complete()},t}(s.OuterSubscriber)},function(e,t,n){"use strict";n.r(t),n.d(t,"pairwise",function(){return o});var r=n(40),i=n(39);function o(){return function(e){return e.lift(new s)}}var s=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new a(e))},e}(),a=function(e){function t(t){var n=e.call(this,t)||this;return n.hasPrev=!1,n}return r.__extends(t,e),t.prototype._next=function(e){this.hasPrev?this.destination.next([this.prev,e]):this.hasPrev=!0,this.prev=e},t}(i.Subscriber)},function(e,t,n){"use strict";n.r(t),n.d(t,"partition",function(){return o});var r=n(191),i=n(161);function o(e,t){return function(n){return[Object(i.filter)(e,t)(n),Object(i.filter)(Object(r.not)(e,t))(n)]}}},function(e,t,n){"use strict";function r(e,t){function n(){return!n.pred.apply(n.thisArg,arguments)}return n.pred=e,n.thisArg=t,n}n.r(t),n.d(t,"not",function(){return r})},function(e,t,n){"use strict";n.r(t),n.d(t,"pluck",function(){return i});var r=n(95);function i(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=e.length;if(0===n)throw new Error("list of properties cannot be empty.");return function(t){return Object(r.map)(function(e,t){return function(n){for(var r=n,i=0;i<t;i++){var o=r[e[i]];if(void 0===o)return;r=o}return r}}(e,n))(t)}}},function(e,t,n){"use strict";n.r(t),n.d(t,"publish",function(){return o});var r=n(56),i=n(187);function o(e){return e?Object(i.multicast)(function(){return new r.Subject},e):Object(i.multicast)(new r.Subject)}},function(e,t,n){"use strict";n.r(t),n.d(t,"publishBehavior",function(){return o});var r=n(61),i=n(187);function o(e){return function(t){return Object(i.multicast)(new r.BehaviorSubject(e))(t)}}},function(e,t,n){"use strict";n.r(t),n.d(t,"publishLast",function(){return o});var r=n(79),i=n(187);function o(){return function(e){return Object(i.multicast)(new r.AsyncSubject)(e)}}},function(e,t,n){"use strict";n.r(t),n.d(t,"publishReplay",function(){return o});var r=n(62),i=n(187);function o(e,t,n,o){n&&"function"!=typeof n&&(o=n);var s="function"==typeof n?n:void 0,a=new r.ReplaySubject(e,t,o);return function(e){return Object(i.multicast)(function(){return a},s)(e)}}},function(e,t,n){"use strict";n.r(t),n.d(t,"race",function(){return o});var r=n(46),i=n(130);function o(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return 1===e.length&&Object(r.isArray)(e[0])&&(e=e[0]),t.lift.call(i.race.apply(void 0,[t].concat(e)))}}},function(e,t,n){"use strict";n.r(t),n.d(t,"repeat",function(){return s});var r=n(40),i=n(39),o=n(72);function s(e){return void 0===e&&(e=-1),function(t){return 0===e?Object(o.empty)():e<0?t.lift(new a(-1,t)):t.lift(new a(e-1,t))}}var a=function(){function e(e,t){this.count=e,this.source=t}return e.prototype.call=function(e,t){return t.subscribe(new c(e,this.count,this.source))},e}(),c=function(e){function t(t,n,r){var i=e.call(this,t)||this;return i.count=n,i.source=r,i}return r.__extends(t,e),t.prototype.complete=function(){if(!this.isStopped){var t=this.source,n=this.count;if(0===n)return e.prototype.complete.call(this);n>-1&&(this.count=n-1),t.subscribe(this._unsubscribeAndRecycle())}},t}(i.Subscriber)},function(e,t,n){"use strict";n.r(t),n.d(t,"repeatWhen",function(){return u});var r=n(40),i=n(56),o=n(48),s=n(49),a=n(98),c=n(99);function u(e){return function(t){return t.lift(new d(e))}}var d=function(){function e(e){this.notifier=e}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.notifier,t))},e}(),l=function(e){function t(t,n,r){var i=e.call(this,t)||this;return i.notifier=n,i.source=r,i.sourceIsBeingSubscribedTo=!0,i}return r.__extends(t,e),t.prototype.notifyNext=function(e,t,n,r,i){this.sourceIsBeingSubscribedTo=!0,this.source.subscribe(this)},t.prototype.notifyComplete=function(t){if(!1===this.sourceIsBeingSubscribedTo)return e.prototype.complete.call(this)},t.prototype.complete=function(){if(this.sourceIsBeingSubscribedTo=!1,!this.isStopped){if(this.retries||this.subscribeToRetries(),!this.retriesSubscription||this.retriesSubscription.closed)return e.prototype.complete.call(this);this._unsubscribeAndRecycle(),this.notifications.next()}},t.prototype._unsubscribe=function(){var e=this.notifications,t=this.retriesSubscription;e&&(e.unsubscribe(),this.notifications=null),t&&(t.unsubscribe(),this.retriesSubscription=null),this.retries=null},t.prototype._unsubscribeAndRecycle=function(){var t=this._unsubscribe;return this._unsubscribe=null,e.prototype._unsubscribeAndRecycle.call(this),this._unsubscribe=t,this},t.prototype.subscribeToRetries=function(){this.notifications=new i.Subject;var t=Object(o.tryCatch)(this.notifier)(this.notifications);if(t===s.errorObject)return e.prototype.complete.call(this);this.retries=t,this.retriesSubscription=Object(c.subscribeToResult)(this,t)},t}(a.OuterSubscriber)},function(e,t,n){"use strict";n.r(t),n.d(t,"retry",function(){return o});var r=n(40),i=n(39);function o(e){return void 0===e&&(e=-1),function(t){return t.lift(new s(e,t))}}var s=function(){function e(e,t){this.count=e,this.source=t}return e.prototype.call=function(e,t){return t.subscribe(new a(e,this.count,this.source))},e}(),a=function(e){function t(t,n,r){var i=e.call(this,t)||this;return i.count=n,i.source=r,i}return r.__extends(t,e),t.prototype.error=function(t){if(!this.isStopped){var n=this.source,r=this.count;if(0===r)return e.prototype.error.call(this,t);r>-1&&(this.count=r-1),n.subscribe(this._unsubscribeAndRecycle())}},t}(i.Subscriber)},function(e,t,n){"use strict";n.r(t),n.d(t,"retryWhen",function(){return u});var r=n(40),i=n(56),o=n(48),s=n(49),a=n(98),c=n(99);function u(e){return function(t){return t.lift(new d(e,t))}}var d=function(){function e(e,t){this.notifier=e,this.source=t}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.notifier,this.source))},e}(),l=function(e){function t(t,n,r){var i=e.call(this,t)||this;return i.notifier=n,i.source=r,i}return r.__extends(t,e),t.prototype.error=function(t){if(!this.isStopped){var n=this.errors,r=this.retries,a=this.retriesSubscription;if(r)this.errors=null,this.retriesSubscription=null;else{if(n=new i.Subject,(r=Object(o.tryCatch)(this.notifier)(n))===s.errorObject)return e.prototype.error.call(this,s.errorObject.e);a=Object(c.subscribeToResult)(this,r)}this._unsubscribeAndRecycle(),this.errors=n,this.retries=r,this.retriesSubscription=a,n.next(t)}},t.prototype._unsubscribe=function(){var e=this.errors,t=this.retriesSubscription;e&&(e.unsubscribe(),this.errors=null),t&&(t.unsubscribe(),this.retriesSubscription=null),this.retries=null},t.prototype.notifyNext=function(e,t,n,r,i){var o=this._unsubscribe;this._unsubscribe=null,this._unsubscribeAndRecycle(),this._unsubscribe=o,this.source.subscribe(this)},t}(a.OuterSubscriber)},function(e,t,n){"use strict";n.r(t),n.d(t,"sample",function(){return s});var r=n(40),i=n(98),o=n(99);function s(e){return function(t){return t.lift(new a(e))}}var a=function(){function e(e){this.notifier=e}return e.prototype.call=function(e,t){var n=new c(e),r=t.subscribe(n);return r.add(Object(o.subscribeToResult)(n,this.notifier)),r},e}(),c=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.hasValue=!1,t}return r.__extends(t,e),t.prototype._next=function(e){this.value=e,this.hasValue=!0},t.prototype.notifyNext=function(e,t,n,r,i){this.emitValue()},t.prototype.notifyComplete=function(){this.emitValue()},t.prototype.emitValue=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.value))},t}(i.OuterSubscriber)},function(e,t,n){"use strict";n.r(t),n.d(t,"sampleTime",function(){return s});var r=n(40),i=n(39),o=n(84);function s(e,t){return void 0===t&&(t=o.async),function(n){return n.lift(new a(e,t))}}var a=function(){function e(e,t){this.period=e,this.scheduler=t}return e.prototype.call=function(e,t){return t.subscribe(new c(e,this.period,this.scheduler))},e}(),c=function(e){function t(t,n,r){var i=e.call(this,t)||this;return i.period=n,i.scheduler=r,i.hasValue=!1,i.add(r.schedule(u,n,{subscriber:i,period:n})),i}return r.__extends(t,e),t.prototype._next=function(e){this.lastValue=e,this.hasValue=!0},t.prototype.notifyNext=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.lastValue))},t}(i.Subscriber);function u(e){var t=e.subscriber,n=e.period;t.notifyNext(),this.schedule(e,n)}},function(e,t,n){"use strict";n.r(t),n.d(t,"sequenceEqual",function(){return a}),n.d(t,"SequenceEqualOperator",function(){return c}),n.d(t,"SequenceEqualSubscriber",function(){return u});var r=n(40),i=n(39),o=n(48),s=n(49);function a(e,t){return function(n){return n.lift(new c(e,t))}}var c=function(){function e(e,t){this.compareTo=e,this.comparor=t}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.compareTo,this.comparor))},e}(),u=function(e){function t(t,n,r){var i=e.call(this,t)||this;return i.compareTo=n,i.comparor=r,i._a=[],i._b=[],i._oneComplete=!1,i.add(n.subscribe(new d(t,i))),i}return r.__extends(t,e),t.prototype._next=function(e){this._oneComplete&&0===this._b.length?this.emit(!1):(this._a.push(e),this.checkValues())},t.prototype._complete=function(){this._oneComplete?this.emit(0===this._a.length&&0===this._b.length):this._oneComplete=!0},t.prototype.checkValues=function(){for(var e=this._a,t=this._b,n=this.comparor;e.length>0&&t.length>0;){var r=e.shift(),i=t.shift(),a=!1;n?(a=Object(o.tryCatch)(n)(r,i))===s.errorObject&&this.destination.error(s.errorObject.e):a=r===i,a||this.emit(!1)}},t.prototype.emit=function(e){var t=this.destination;t.next(e),t.complete()},t.prototype.nextB=function(e){this._oneComplete&&0===this._a.length?this.emit(!1):(this._b.push(e),this.checkValues())},t}(i.Subscriber),d=function(e){function t(t,n){var r=e.call(this,t)||this;return r.parent=n,r}return r.__extends(t,e),t.prototype._next=function(e){this.parent.nextB(e)},t.prototype._error=function(e){this.parent.error(e)},t.prototype._complete=function(){this.parent._complete()},t}(i.Subscriber)},function(e,t,n){"use strict";n.r(t),n.d(t,"share",function(){return a});var r=n(187),i=n(59),o=n(56);function s(){return new o.Subject}function a(){return function(e){return Object(i.refCount)()(Object(r.multicast)(s)(e))}}},function(e,t,n){"use strict";n.r(t),n.d(t,"shareReplay",function(){return i});var r=n(62);function i(e,t,n){return function(i){return i.lift(function(e,t,n){var i,o,s=0,a=!1,c=!1;return function(u){s++,i&&!a||(a=!1,i=new r.ReplaySubject(e,t,n),o=u.subscribe({next:function(e){i.next(e)},error:function(e){a=!0,i.error(e)},complete:function(){c=!0,i.complete()}}));var d=i.subscribe(this);return function(){s--,d.unsubscribe(),o&&0===s&&c&&o.unsubscribe()}}}(e,t,n))}}},function(e,t,n){"use strict";n.r(t),n.d(t,"single",function(){return s});var r=n(40),i=n(39),o=n(92);function s(e){return function(t){return t.lift(new a(e,t))}}var a=function(){function e(e,t){this.predicate=e,this.source=t}return e.prototype.call=function(e,t){return t.subscribe(new c(e,this.predicate,this.source))},e}(),c=function(e){function t(t,n,r){var i=e.call(this,t)||this;return i.predicate=n,i.source=r,i.seenValue=!1,i.index=0,i}return r.__extends(t,e),t.prototype.applySingleValue=function(e){this.seenValue?this.destination.error("Sequence contains more than one element"):(this.seenValue=!0,this.singleValue=e)},t.prototype._next=function(e){var t=this.index++;this.predicate?this.tryNext(e,t):this.applySingleValue(e)},t.prototype.tryNext=function(e,t){try{this.predicate(e,t,this.source)&&this.applySingleValue(e)}catch(n){this.destination.error(n)}},t.prototype._complete=function(){var e=this.destination;this.index>0?(e.next(this.seenValue?this.singleValue:void 0),e.complete()):e.error(new o.EmptyError)},t}(i.Subscriber)},function(e,t,n){"use strict";n.r(t),n.d(t,"skip",function(){return o});var r=n(40),i=n(39);function o(e){return function(t){return t.lift(new s(e))}}var s=function(){function e(e){this.total=e}return e.prototype.call=function(e,t){return t.subscribe(new a(e,this.total))},e}(),a=function(e){function t(t,n){var r=e.call(this,t)||this;return r.total=n,r.count=0,r}return r.__extends(t,e),t.prototype._next=function(e){++this.count>this.total&&this.destination.next(e)},t}(i.Subscriber)},function(e,t,n){"use strict";n.r(t),n.d(t,"skipLast",function(){return s});var r=n(40),i=n(39),o=n(91);function s(e){return function(t){return t.lift(new a(e))}}var a=function(){function e(e){if(this._skipCount=e,this._skipCount<0)throw new o.ArgumentOutOfRangeError}return e.prototype.call=function(e,t){return 0===this._skipCount?t.subscribe(new i.Subscriber(e)):t.subscribe(new c(e,this._skipCount))},e}(),c=function(e){function t(t,n){var r=e.call(this,t)||this;return r._skipCount=n,r._count=0,r._ring=new Array(n),r}return r.__extends(t,e),t.prototype._next=function(e){var t=this._skipCount,n=this._count++;if(n<t)this._ring[n]=e;else{var r=n%t,i=this._ring,o=i[r];i[r]=e,this.destination.next(o)}},t}(i.Subscriber)},function(e,t,n){"use strict";n.r(t),n.d(t,"skipUntil",function(){return s});var r=n(40),i=n(98),o=n(99);function s(e){return function(t){return t.lift(new a(e))}}var a=function(){function e(e){this.notifier=e}return e.prototype.call=function(e,t){return t.subscribe(new c(e,this.notifier))},e}(),c=function(e){function t(t,n){var r=e.call(this,t)||this;return r.hasValue=!1,r.add(r.innerSubscription=Object(o.subscribeToResult)(r,n)),r}return r.__extends(t,e),t.prototype._next=function(t){this.hasValue&&e.prototype._next.call(this,t)},t.prototype.notifyNext=function(e,t,n,r,i){this.hasValue=!0,this.innerSubscription&&this.innerSubscription.unsubscribe()},t.prototype.notifyComplete=function(){},t}(i.OuterSubscriber)},function(e,t,n){"use strict";n.r(t),n.d(t,"skipWhile",function(){return o});var r=n(40),i=n(39);function o(e){return function(t){return t.lift(new s(e))}}var s=function(){function e(e){this.predicate=e}return e.prototype.call=function(e,t){return t.subscribe(new a(e,this.predicate))},e}(),a=function(e){function t(t,n){var r=e.call(this,t)||this;return r.predicate=n,r.skipping=!0,r.index=0,r}return r.__extends(t,e),t.prototype._next=function(e){var t=this.destination;this.skipping&&this.tryCallPredicate(e),this.skipping||t.next(e)},t.prototype.tryCallPredicate=function(e){try{var t=this.predicate(e,this.index++);this.skipping=Boolean(t)}catch(n){this.destination.error(n)}},t}(i.Subscriber)},function(e,t,n){"use strict";n.r(t),n.d(t,"startWith",function(){return c});var r=n(75),i=n(77),o=n(72),s=n(108),a=n(74);function c(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){var n=e[e.length-1];Object(a.isScheduler)(n)?e.pop():n=null;var c=e.length;return 1!==c||n?c>0?Object(s.concat)(Object(r.fromArray)(e,n),t):Object(s.concat)(Object(o.empty)(n),t):Object(s.concat)(Object(i.scalar)(e[0]),t)}}},function(e,t,n){"use strict";n.r(t),n.d(t,"subscribeOn",function(){return i});var r=n(214);function i(e,t){return void 0===t&&(t=0),function(n){return n.lift(new o(e,t))}}var o=function(){function e(e,t){this.scheduler=e,this.delay=t}return e.prototype.call=function(e,t){return new r.SubscribeOnObservable(t,this.delay,this.scheduler).subscribe(e)},e}()},function(e,t,n){"use strict";n.r(t),n.d(t,"SubscribeOnObservable",function(){return a});var r=n(40),i=n(37),o=n(80),s=n(125),a=function(e){function t(t,n,r){void 0===n&&(n=0),void 0===r&&(r=o.asap);var i=e.call(this)||this;return i.source=t,i.delayTime=n,i.scheduler=r,(!Object(s.isNumeric)(n)||n<0)&&(i.delayTime=0),r&&"function"==typeof r.schedule||(i.scheduler=o.asap),i}return r.__extends(t,e),t.create=function(e,n,r){return void 0===n&&(n=0),void 0===r&&(r=o.asap),new t(e,n,r)},t.dispatch=function(e){var t=e.source,n=e.subscriber;return this.add(t.subscribe(n))},t.prototype._subscribe=function(e){var n=this.delayTime,r=this.source;return this.scheduler.schedule(t.dispatch,n,{source:r,subscriber:e})},t}(i.Observable)},function(e,t,n){"use strict";n.r(t),n.d(t,"switchAll",function(){return o});var r=n(216),i=n(89);function o(){return Object(r.switchMap)(i.identity)}},function(e,t,n){"use strict";n.r(t),n.d(t,"switchMap",function(){return c});var r=n(40),i=n(98),o=n(99),s=n(95),a=n(109);function c(e,t){return"function"==typeof t?function(n){return n.pipe(c(function(n,r){return Object(a.from)(e(n,r)).pipe(Object(s.map)(function(e,i){return t(n,e,r,i)}))}))}:function(t){return t.lift(new u(e))}}var u=function(){function e(e){this.project=e}return e.prototype.call=function(e,t){return t.subscribe(new d(e,this.project))},e}(),d=function(e){function t(t,n){var r=e.call(this,t)||this;return r.project=n,r.index=0,r}return r.__extends(t,e),t.prototype._next=function(e){var t,n=this.index++;try{t=this.project(e,n)}catch(r){return void this.destination.error(r)}this._innerSub(t,e,n)},t.prototype._innerSub=function(e,t,n){var r=this.innerSubscription;r&&r.unsubscribe(),this.add(this.innerSubscription=Object(o.subscribeToResult)(this,e,t,n))},t.prototype._complete=function(){var t=this.innerSubscription;t&&!t.closed||e.prototype._complete.call(this)},t.prototype._unsubscribe=function(){this.innerSubscription=null},t.prototype.notifyComplete=function(t){this.remove(t),this.innerSubscription=null,this.isStopped&&e.prototype._complete.call(this)},t.prototype.notifyNext=function(e,t,n,r,i){this.destination.next(t)},t}(i.OuterSubscriber)},function(e,t,n){"use strict";n.r(t),n.d(t,"switchMapTo",function(){return i});var r=n(216);function i(e,t){return t?Object(r.switchMap)(function(){return e},t):Object(r.switchMap)(function(){return e})}},function(e,t,n){"use strict";n.r(t),n.d(t,"takeUntil",function(){return s});var r=n(40),i=n(98),o=n(99);function s(e){return function(t){return t.lift(new a(e))}}var a=function(){function e(e){this.notifier=e}return e.prototype.call=function(e,t){var n=new c(e),r=Object(o.subscribeToResult)(n,this.notifier);return r&&!r.closed?(n.add(r),t.subscribe(n)):n},e}(),c=function(e){function t(t){return e.call(this,t)||this}return r.__extends(t,e),t.prototype.notifyNext=function(e,t,n,r,i){this.complete()},t.prototype.notifyComplete=function(){},t}(i.OuterSubscriber)},function(e,t,n){"use strict";n.r(t),n.d(t,"takeWhile",function(){return o});var r=n(40),i=n(39);function o(e){return function(t){return t.lift(new s(e))}}var s=function(){function e(e){this.predicate=e}return e.prototype.call=function(e,t){return t.subscribe(new a(e,this.predicate))},e}(),a=function(e){function t(t,n){var r=e.call(this,t)||this;return r.predicate=n,r.index=0,r}return r.__extends(t,e),t.prototype._next=function(e){var t,n=this.destination;try{t=this.predicate(e,this.index++)}catch(r){return void n.error(r)}this.nextOrComplete(e,t)},t.prototype.nextOrComplete=function(e,t){var n=this.destination;Boolean(t)?n.next(e):n.complete()},t}(i.Subscriber)},function(e,t,n){"use strict";n.r(t),n.d(t,"defaultThrottleConfig",function(){return s}),n.d(t,"throttle",function(){return a});var r=n(40),i=n(98),o=n(99),s={leading:!0,trailing:!1};function a(e,t){return void 0===t&&(t=s),function(n){return n.lift(new c(e,t.leading,t.trailing))}}var c=function(){function e(e,t,n){this.durationSelector=e,this.leading=t,this.trailing=n}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.durationSelector,this.leading,this.trailing))},e}(),u=function(e){function t(t,n,r,i){var o=e.call(this,t)||this;return o.destination=t,o.durationSelector=n,o._leading=r,o._trailing=i,o._hasValue=!1,o}return r.__extends(t,e),t.prototype._next=function(e){this._hasValue=!0,this._sendValue=e,this._throttled||(this._leading?this.send():this.throttle(e))},t.prototype.send=function(){var e=this._hasValue,t=this._sendValue;e&&(this.destination.next(t),this.throttle(t)),this._hasValue=!1,this._sendValue=null},t.prototype.throttle=function(e){var t=this.tryDurationSelector(e);t&&this.add(this._throttled=Object(o.subscribeToResult)(this,t))},t.prototype.tryDurationSelector=function(e){try{return this.durationSelector(e)}catch(t){return this.destination.error(t),null}},t.prototype.throttlingDone=function(){var e=this._throttled,t=this._trailing;e&&e.unsubscribe(),this._throttled=null,t&&this.send()},t.prototype.notifyNext=function(e,t,n,r,i){this.throttlingDone()},t.prototype.notifyComplete=function(){this.throttlingDone()},t}(i.OuterSubscriber)},function(e,t,n){"use strict";n.r(t),n.d(t,"throttleTime",function(){return a});var r=n(40),i=n(39),o=n(84),s=n(220);function a(e,t,n){return void 0===t&&(t=o.async),void 0===n&&(n=s.defaultThrottleConfig),function(r){return r.lift(new c(e,t,n.leading,n.trailing))}}var c=function(){function e(e,t,n,r){this.duration=e,this.scheduler=t,this.leading=n,this.trailing=r}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.duration,this.scheduler,this.leading,this.trailing))},e}(),u=function(e){function t(t,n,r,i,o){var s=e.call(this,t)||this;return s.duration=n,s.scheduler=r,s.leading=i,s.trailing=o,s._hasTrailingValue=!1,s._trailingValue=null,s}return r.__extends(t,e),t.prototype._next=function(e){this.throttled?this.trailing&&(this._trailingValue=e,this._hasTrailingValue=!0):(this.add(this.throttled=this.scheduler.schedule(d,this.duration,{subscriber:this})),this.leading&&this.destination.next(e))},t.prototype._complete=function(){this._hasTrailingValue?(this.destination.next(this._trailingValue),this.destination.complete()):this.destination.complete()},t.prototype.clearThrottle=function(){var e=this.throttled;e&&(this.trailing&&this._hasTrailingValue&&(this.destination.next(this._trailingValue),this._trailingValue=null,this._hasTrailingValue=!1),e.unsubscribe(),this.remove(e),this.throttled=null)},t}(i.Subscriber);function d(e){e.subscriber.clearThrottle()}},function(e,t,n){"use strict";n.r(t),n.d(t,"timeInterval",function(){return a}),n.d(t,"TimeInterval",function(){return c});var r=n(84),i=n(182),o=n(118),s=n(95);function a(e){return void 0===e&&(e=r.async),function(t){return Object(o.defer)(function(){return t.pipe(Object(i.scan)(function(t,n){var r=t.current;return{value:n,current:e.now(),last:r}},{current:e.now(),value:void 0,last:void 0}),Object(s.map)(function(e){var t=e.current,n=e.last,r=e.value;return new c(r,t-n)}))})}}var c=function(){return function(e,t){this.value=e,this.interval=t}}()},function(e,t,n){"use strict";n.r(t),n.d(t,"timeout",function(){return a});var r=n(84),i=n(93),o=n(224),s=n(78);function a(e,t){return void 0===t&&(t=r.async),Object(o.timeoutWith)(e,Object(s.throwError)(new i.TimeoutError),t)}},function(e,t,n){"use strict";n.r(t),n.d(t,"timeoutWith",function(){return c});var r=n(40),i=n(84),o=n(154),s=n(98),a=n(99);function c(e,t,n){return void 0===n&&(n=i.async),function(r){var i=Object(o.isDate)(e),s=i?+e-n.now():Math.abs(e);return r.lift(new u(s,i,t,n))}}var u=function(){function e(e,t,n,r){this.waitFor=e,this.absoluteTimeout=t,this.withObservable=n,this.scheduler=r}return e.prototype.call=function(e,t){return t.subscribe(new d(e,this.absoluteTimeout,this.waitFor,this.withObservable,this.scheduler))},e}(),d=function(e){function t(t,n,r,i,o){var s=e.call(this,t)||this;return s.absoluteTimeout=n,s.waitFor=r,s.withObservable=i,s.scheduler=o,s.action=null,s.scheduleTimeout(),s}return r.__extends(t,e),t.dispatchTimeout=function(e){var t=e.withObservable;e._unsubscribeAndRecycle(),e.add(Object(a.subscribeToResult)(e,t))},t.prototype.scheduleTimeout=function(){var e=this.action;e?this.action=e.schedule(this,this.waitFor):this.add(this.action=this.scheduler.schedule(t.dispatchTimeout,this.waitFor,this))},t.prototype._next=function(t){this.absoluteTimeout||this.scheduleTimeout(),e.prototype._next.call(this,t)},t.prototype._unsubscribe=function(){this.action=null,this.scheduler=null,this.withObservable=null},t}(s.OuterSubscriber)},function(e,t,n){"use strict";n.r(t),n.d(t,"timestamp",function(){return o}),n.d(t,"Timestamp",function(){return s});var r=n(84),i=n(95);function o(e){return void 0===e&&(e=r.async),Object(i.map)(function(t){return new s(t,e.now())})}var s=function(){return function(e,t){this.value=e,this.timestamp=t}}()},function(e,t,n){"use strict";n.r(t),n.d(t,"toArray",function(){return o});var r=n(181);function i(e,t,n){return 0===n?[t]:(e.push(t),e)}function o(){return Object(r.reduce)(i,[])}},function(e,t,n){"use strict";n.r(t),n.d(t,"window",function(){return a});var r=n(40),i=n(56),o=n(98),s=n(99);function a(e){return function(t){return t.lift(new c(e))}}var c=function(){function e(e){this.windowBoundaries=e}return e.prototype.call=function(e,t){var n=new u(e),r=t.subscribe(n);return r.closed||n.add(Object(s.subscribeToResult)(n,this.windowBoundaries)),r},e}(),u=function(e){function t(t){var n=e.call(this,t)||this;return n.window=new i.Subject,t.next(n.window),n}return r.__extends(t,e),t.prototype.notifyNext=function(e,t,n,r,i){this.openWindow()},t.prototype.notifyError=function(e,t){this._error(e)},t.prototype.notifyComplete=function(e){this._complete()},t.prototype._next=function(e){this.window.next(e)},t.prototype._error=function(e){this.window.error(e),this.destination.error(e)},t.prototype._complete=function(){this.window.complete(),this.destination.complete()},t.prototype._unsubscribe=function(){this.window=null},t.prototype.openWindow=function(){var e=this.window;e&&e.complete();var t=this.destination,n=this.window=new i.Subject;t.next(n)},t}(o.OuterSubscriber)},function(e,t,n){"use strict";n.r(t),n.d(t,"windowCount",function(){return s});var r=n(40),i=n(39),o=n(56);function s(e,t){return void 0===t&&(t=0),function(n){return n.lift(new a(e,t))}}var a=function(){function e(e,t){this.windowSize=e,this.startWindowEvery=t}return e.prototype.call=function(e,t){return t.subscribe(new c(e,this.windowSize,this.startWindowEvery))},e}(),c=function(e){function t(t,n,r){var i=e.call(this,t)||this;return i.destination=t,i.windowSize=n,i.startWindowEvery=r,i.windows=[new o.Subject],i.count=0,t.next(i.windows[0]),i}return r.__extends(t,e),t.prototype._next=function(e){for(var t=this.startWindowEvery>0?this.startWindowEvery:this.windowSize,n=this.destination,r=this.windowSize,i=this.windows,s=i.length,a=0;a<s&&!this.closed;a++)i[a].next(e);var c=this.count-r+1;if(c>=0&&c%t==0&&!this.closed&&i.shift().complete(),++this.count%t==0&&!this.closed){var u=new o.Subject;i.push(u),n.next(u)}},t.prototype._error=function(e){var t=this.windows;if(t)for(;t.length>0&&!this.closed;)t.shift().error(e);this.destination.error(e)},t.prototype._complete=function(){var e=this.windows;if(e)for(;e.length>0&&!this.closed;)e.shift().complete();this.destination.complete()},t.prototype._unsubscribe=function(){this.count=0,this.windows=null},t}(i.Subscriber)},function(e,t,n){"use strict";n.r(t),n.d(t,"windowTime",function(){return u});var r=n(40),i=n(56),o=n(84),s=n(39),a=n(125),c=n(74);function u(e){var t=o.async,n=null,r=Number.POSITIVE_INFINITY;return Object(c.isScheduler)(arguments[3])&&(t=arguments[3]),Object(c.isScheduler)(arguments[2])?t=arguments[2]:Object(a.isNumeric)(arguments[2])&&(r=arguments[2]),Object(c.isScheduler)(arguments[1])?t=arguments[1]:Object(a.isNumeric)(arguments[1])&&(n=arguments[1]),function(i){return i.lift(new d(e,n,r,t))}}var d=function(){function e(e,t,n,r){this.windowTimeSpan=e,this.windowCreationInterval=t,this.maxWindowSize=n,this.scheduler=r}return e.prototype.call=function(e,t){return t.subscribe(new f(e,this.windowTimeSpan,this.windowCreationInterval,this.maxWindowSize,this.scheduler))},e}(),l=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._numberOfNextedValues=0,t}return r.__extends(t,e),t.prototype.next=function(t){this._numberOfNextedValues++,e.prototype.next.call(this,t)},Object.defineProperty(t.prototype,"numberOfNextedValues",{get:function(){return this._numberOfNextedValues},enumerable:!0,configurable:!0}),t}(i.Subject),f=function(e){function t(t,n,r,i,o){var s=e.call(this,t)||this;s.destination=t,s.windowTimeSpan=n,s.windowCreationInterval=r,s.maxWindowSize=i,s.scheduler=o,s.windows=[];var a=s.openWindow();if(null!==r&&r>=0){var c={subscriber:s,window:a,context:null},u={windowTimeSpan:n,windowCreationInterval:r,subscriber:s,scheduler:o};s.add(o.schedule(m,n,c)),s.add(o.schedule(h,r,u))}else{var d={subscriber:s,window:a,windowTimeSpan:n};s.add(o.schedule(p,n,d))}return s}return r.__extends(t,e),t.prototype._next=function(e){for(var t=this.windows,n=t.length,r=0;r<n;r++){var i=t[r];i.closed||(i.next(e),i.numberOfNextedValues>=this.maxWindowSize&&this.closeWindow(i))}},t.prototype._error=function(e){for(var t=this.windows;t.length>0;)t.shift().error(e);this.destination.error(e)},t.prototype._complete=function(){for(var e=this.windows;e.length>0;){var t=e.shift();t.closed||t.complete()}this.destination.complete()},t.prototype.openWindow=function(){var e=new l;return this.windows.push(e),this.destination.next(e),e},t.prototype.closeWindow=function(e){e.complete();var t=this.windows;t.splice(t.indexOf(e),1)},t}(s.Subscriber);function p(e){var t=e.subscriber,n=e.windowTimeSpan,r=e.window;r&&t.closeWindow(r),e.window=t.openWindow(),this.schedule(e,n)}function h(e){var t=e.windowTimeSpan,n=e.subscriber,r=e.scheduler,i=e.windowCreationInterval,o=n.openWindow(),s={action:this,subscription:null},a={subscriber:n,window:o,context:s};s.subscription=r.schedule(m,t,a),this.add(s.subscription),this.schedule(e,i)}function m(e){var t=e.subscriber,n=e.window,r=e.context;r&&r.action&&r.subscription&&r.action.remove(r.subscription),t.closeWindow(n)}},function(e,t,n){"use strict";n.r(t),n.d(t,"windowToggle",function(){return d});var r=n(40),i=n(56),o=n(45),s=n(48),a=n(49),c=n(98),u=n(99);function d(e,t){return function(n){return n.lift(new l(e,t))}}var l=function(){function e(e,t){this.openings=e,this.closingSelector=t}return e.prototype.call=function(e,t){return t.subscribe(new f(e,this.openings,this.closingSelector))},e}(),f=function(e){function t(t,n,r){var i=e.call(this,t)||this;return i.openings=n,i.closingSelector=r,i.contexts=[],i.add(i.openSubscription=Object(u.subscribeToResult)(i,n,n)),i}return r.__extends(t,e),t.prototype._next=function(e){var t=this.contexts;if(t)for(var n=t.length,r=0;r<n;r++)t[r].window.next(e)},t.prototype._error=function(t){var n=this.contexts;if(this.contexts=null,n)for(var r=n.length,i=-1;++i<r;){var o=n[i];o.window.error(t),o.subscription.unsubscribe()}e.prototype._error.call(this,t)},t.prototype._complete=function(){var t=this.contexts;if(this.contexts=null,t)for(var n=t.length,r=-1;++r<n;){var i=t[r];i.window.complete(),i.subscription.unsubscribe()}e.prototype._complete.call(this)},t.prototype._unsubscribe=function(){var e=this.contexts;if(this.contexts=null,e)for(var t=e.length,n=-1;++n<t;){var r=e[n];r.window.unsubscribe(),r.subscription.unsubscribe()}},t.prototype.notifyNext=function(e,t,n,r,c){if(e===this.openings){var d=this.closingSelector,l=Object(s.tryCatch)(d)(t);if(l===a.errorObject)return this.error(a.errorObject.e);var f=new i.Subject,p=new o.Subscription,h={window:f,subscription:p};this.contexts.push(h);var m=Object(u.subscribeToResult)(this,l,h);m.closed?this.closeWindow(this.contexts.length-1):(m.context=h,p.add(m)),this.destination.next(f)}else this.closeWindow(this.contexts.indexOf(e))},t.prototype.notifyError=function(e){this.error(e)},t.prototype.notifyComplete=function(e){e!==this.openSubscription&&this.closeWindow(this.contexts.indexOf(e.context))},t.prototype.closeWindow=function(e){if(-1!==e){var t=this.contexts,n=t[e],r=n.window,i=n.subscription;t.splice(e,1),r.complete(),i.unsubscribe()}},t}(c.OuterSubscriber)},function(e,t,n){"use strict";n.r(t),n.d(t,"windowWhen",function(){return u});var r=n(40),i=n(56),o=n(48),s=n(49),a=n(98),c=n(99);function u(e){return function(t){return t.lift(new d(e))}}var d=function(){function e(e){this.closingSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.closingSelector))},e}(),l=function(e){function t(t,n){var r=e.call(this,t)||this;return r.destination=t,r.closingSelector=n,r.openWindow(),r}return r.__extends(t,e),t.prototype.notifyNext=function(e,t,n,r,i){this.openWindow(i)},t.prototype.notifyError=function(e,t){this._error(e)},t.prototype.notifyComplete=function(e){this.openWindow(e)},t.prototype._next=function(e){this.window.next(e)},t.prototype._error=function(e){this.window.error(e),this.destination.error(e),this.unsubscribeClosingNotification()},t.prototype._complete=function(){this.window.complete(),this.destination.complete(),this.unsubscribeClosingNotification()},t.prototype.unsubscribeClosingNotification=function(){this.closingNotification&&this.closingNotification.unsubscribe()},t.prototype.openWindow=function(e){void 0===e&&(e=null),e&&(this.remove(e),e.unsubscribe());var t=this.window;t&&t.complete();var n=this.window=new i.Subject;this.destination.next(n);var r=Object(o.tryCatch)(this.closingSelector)();if(r===s.errorObject){var a=s.errorObject.e;this.destination.error(a),this.window.error(a)}else this.add(this.closingNotification=Object(c.subscribeToResult)(this,r))},t}(a.OuterSubscriber)},function(e,t,n){"use strict";n.r(t),n.d(t,"withLatestFrom",function(){return s});var r=n(40),i=n(98),o=n(99);function s(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){var n;"function"==typeof e[e.length-1]&&(n=e.pop());var r=e;return t.lift(new a(r,n))}}var a=function(){function e(e,t){this.observables=e,this.project=t}return e.prototype.call=function(e,t){return t.subscribe(new c(e,this.observables,this.project))},e}(),c=function(e){function t(t,n,r){var i=e.call(this,t)||this;i.observables=n,i.project=r,i.toRespond=[];var s=n.length;i.values=new Array(s);for(var a=0;a<s;a++)i.toRespond.push(a);for(a=0;a<s;a++){var c=n[a];i.add(Object(o.subscribeToResult)(i,c,c,a))}return i}return r.__extends(t,e),t.prototype.notifyNext=function(e,t,n,r,i){this.values[n]=t;var o=this.toRespond;if(o.length>0){var s=o.indexOf(n);-1!==s&&o.splice(s,1)}},t.prototype.notifyComplete=function(){},t.prototype._next=function(e){if(0===this.toRespond.length){var t=[e].concat(this.values);this.project?this._tryProject(t):this.destination.next(t)}},t.prototype._tryProject=function(e){var t;try{t=this.project.apply(this,e)}catch(n){return void this.destination.error(n)}this.destination.next(t)},t}(i.OuterSubscriber)},function(e,t,n){"use strict";n.r(t),n.d(t,"zip",function(){return i});var r=n(134);function i(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return t.lift.call(r.zip.apply(void 0,[t].concat(e)))}}},function(e,t,n){"use strict";n.r(t),n.d(t,"zipAll",function(){return i});var r=n(134);function i(e){return function(t){return t.lift(new r.ZipOperator(e))}}},function(e,t,n){"use strict";n.r(t);var r=n(15),i=n.n(r),o=n(36),s=n(6),a=n.n(s);t.default=function(e,t,n){this.mgr=e,this.confrId=t,function(){i.a.extend(this,{subscribe:function(e,t,n){return this.subject.subscribe(e,t,n)}},{onMeExit:function(e,t){this.mgr._onExit(this.confrId,e,t)},onAddMember:function(e){this.mgr.onMemberJoin(e,this.confrId)},onRemoveMember:function(e,t){this.mgr.onMemberLeave(e,t,this.confrId)},onAddStream:function(e){0!=e.id&&(e.located()||this.onRemoteStream&&this.onRemoteStream(e),this.mgr.streamBindVideo(e,void 0,this.confrId),this.mgr._onAddMemberStream(e,this.confrId))},onRemoveStream:function(e){if(0!=e.id){var t=this.mgr._confr(this.confrId);t&&e&&e.located()&&(t.av&&t.av.id===e.id&&(t.av=void 0),t.desktop&&t.desktop.id===e.id&&(t.desktop=void 0));var n=i.a.removeAttribute(this.mgr._videos,e.id);this.mgr._onRemoveMemberStream(e,this.confrId),n&&this.mgr.unloadVideo(e.owner,e,n)}},onUpdateStream:function(e,t){if(0!=e.id){var n=this,r=this.mgr._videos[e.id];r&&(t&&t.ifMediaStream(function(e){r&&attachMediaStream(r,e),r&&r.hasAttribute("flow")&&n.mgr.onMediaTransmission(r,function(e,t,n,i){a()(r).trigger("onMediaTransmission",[e,t,n,i])})}),e.aoff?r.setAttribute("aoff","aoff"):r.removeAttribute("aoff"),e.voff?r.setAttribute("voff","voff"):r.removeAttribute("voff"));var i={video:!e.voff,audio:!e.aoff};t&&t.ifVoff(function(t){i||(i={}),i.video=!t,e.located()||(i.video=e.subArgs?e.subArgs.subSVideo:!e.voff)}),t&&t.ifAoff(function(t){i||(i={}),i.audio=!t,e.located()||(i.audio=e.subArgs?e.subArgs.subSAudio:!e.aoff,2===e.type&&(i.audio=!0))}),i&&this.mgr._onMemberMediaChanaged(e.owner,e,i,this.confrId),i&&this.mgr._onUpdateMemberStream(e,i,this.confrId)}},onNetworkWeak:function(){},onNotSupportPublishVideoCodecs:function(e){this.mgr._onNotSupportMemberPublishVideoCodecs(e,this.confrId)},onRecvRemoteMessage:function(e,t){this.mgr._onRecvRemoteMessage(e,t,this.confrId)},onSoundChanage:function(e,t,n){this.mgr._onMemberSoundChanaged(e,t,n,this.confrId)},onTalking:function(e,t,n){this.mgr._onTalking(e,t,n,this.confrId)},onRoleUpdate:function(e,t){var n=this.mgr._confrs[this.confrId];t&&(n.roleToken=t),n.role=e,e==this.mgr.Role.AUDIENCE&&(n.av&&this.mgr.hungup(n.av),n.desktop&&this.mgr.hungup(n.desktop)),this.mgr._onRoleUpdated(e,this.confrId)},onNotifyEvent:function(e){var t=this;try{if(e instanceof emedia.event.ICEChanage){var n=e.webrtc,r=e.state;i.a.forEach(t._cacheStreams,function(e,o){if(o.rtcId==n.getRtcId()){var s=i.a.extend({},o),a=i.a.extend({},o.owner);t.mgr._onStreamIceStateChanged(a,s,r,t.confrId)}})}}finally{t.subject.next(e)}}})}.apply(this),this.subject=new o.Subject,this.onRemoteStream=n}},function(e,t,n){var r=n(15),i=r.tagLogger("PannelVideo"),o=n(237),s=n(238),a=(n(31),n(32)),c=n(239);function u(e){u._overrideCount++,u.overrideObj!==e&&(u.overrideObj=e,d.override=e.listeners.onRemoveMember,e.listeners.onRemoveMember=d)}function d(e,t){try{var n=e&&e.id&&function(e,t,n){var i=[];return e.current.__remoteControls&&r.forEach(e.current.__remoteControls,function(e,r){n&&r._ctrlStream.id!==n.id||t&&r._controller.id!==t||i.push(r)}),i}(this._service,e.id);n&&n.length&&r.forEach(n,function(t,n){i.warn("Remove member. free remote controller. it is ",n.id,n._ctrlStream.id,n._controller.memName,e.id),n._free(),n._callbacks&&n._callbacks.onRemoteFreeControl&&n._callbacks.onRemoteFreeControl(n._ctrlStream,n._controller,n._cId)})}finally{d.override&&d.override.apply(this,arguments)}}function l(e){l._overrideCount++,l.overrideObj!==e&&(l.overrideObj=e,f.override=e.listeners.onRemoveStream,e.listeners.onRemoveStream=f)}function f(e){p(this._service,e),f.override&&f.override.apply(this,arguments)}function p(e,t){C(e,t.id);var n=S(e,t);n&&r.forEach(n,function(e,t){t._free&&t._free()}),r.removeAttribute(e.current.__remoteControls,t.id)}function h(e){if(h._overrideCount++,h.overrideObj!==e){h.overrideObj=e;var t=e.onHungup;e.onHungup=function(n){p(e,n),t&&t.apply(this,arguments)}.bind(e)}}function m(e,t){if(m._overrideCount++,m.overrideObj!==e){m.overrideObj=e;var n=e._onRemotePannelControl;e._onRemotePannelControl=function(e){w(this,e,!1,t),n&&n.apply(this,arguments)}.bind(e)}}function v(e,t,n){var i=[];n&&r.forEach(n.actions,function(e,t){t.xy&&i.push({x:Math.round(1e4*t.xy.x),y:Math.round(1e4*t.xy.y),oper:t.oper,btn:t.btn,sn:t.sn,_time:t._time}),t.xy||i.push({oper:t.oper,btn:t.btn,sn:t.sn,_time:t._time})});var o={op2:30,evt:0,streamId:t.id,actions:i,cId:n.cId};return e.current.newMessage({op:1002,memId:t.owner.id,arg:JSON.stringify(o),_reqOps:[100230]})}u._overrideCount=0,l._overrideCount=0,h._overrideCount=0,m._overrideCount=0;var b=0,g=r.prototypeExtend({__init__:function(){this.id=b++},accept:function(e,t){var n=this;if(n.hasOtherControl())throw n.busy(),i.error("Other has been controled."),"Other has been controled.";var o=!1,s=S(this._service,this._ctrlStream,this._controller);(s&&r.forEach(s,function(e,t){t.id<n.id?t._free():o=!0}),o)?n._free():((this._service.current.__remoteControls||(this._service.current.__remoteControls={}))[n.id]=n,T(this,e,t),_(this._service,this._reqevt,0))},controlling:function(){var e=this,t=[],n=S(this._service,this._ctrlStream);return n&&r.forEach(n,function(n,r){r._controller.memName===e._controller.memName&&t.push(r)}),t&&t.length?t:void 0},hasOtherControl:function(){var e=this,t=!1,n=S(this._service,this._ctrlStream);return n&&r.forEach(n,function(n,r){r._controller.memName!=e._controller.memName&&(t=!0)}),t},busy:function(){_(this._service,this._reqevt,-403)},reject:function(){_(this._service,this._reqevt,-402)},_free:function(){r.removeAttribute(this._service.current.__remoteControls,this.id)},forceDisconnect:function(){var e=S(this._service,this._ctrlStream);e&&r.forEach(e,function(e,t){t._free&&t._free()}),i.info("remote control force disconnect")}});function _(e,t,n){e.current.message({op:1001,tsxId:t.tsxId,memId:t.memId,arg:JSON.stringify({cId:t.arg.cId}),result:n}).post()}function y(e,t){_(e,t,-405)}function S(e,t,n,i){var o=[];return e.current.__remoteControls&&r.forEach(e.current.__remoteControls,function(e,r){t&&r._ctrlStream.id!==t.id||n&&r._controller.memName!==n.memName||i&&r._cId!==i||o.push(r)}),o}function w(e,t,n,o){!function(e){"string"==typeof e.arg&&(e.arg=JSON.parse(e.arg));var t=e.arg,n=[],i=[];t&&t.actions&&r.forEach(t.actions,function(e,t){void 0!==t.x&&void 0!==t.y&&n.push({xy:{x:t.x/1e4,y:t.y/1e4},oper:t.oper,btn:t.btn,sn:t.sn,_time:t._time}),(void 0===t.x||void 0===t.y)&&i.push({oper:t.oper,btn:t.btn,sn:t.sn,_time:t._time})}),t.mouse=n,t.keyboard=i}(t);var s=t.arg,c=s.cId,u=s.streamId,d=e.getMemberById(t.memId),l=e.getStreamById(u);if(n||!function(){if(!d||!l)return y(e,t),!0;if(1===s.evt){var n,i=new g({_service:e,_controller:d,_ctrlStream:l,_cId:c,_reqevt:t,_callbacks:o});return i.hasOtherControl()?(i.busy(),!0):(n=i.controlling())?(r.forEach(n,function(e,t){t._cId=c}),_(e,t,0),!0):(o&&o.onHasRemoteControl&&o.onHasRemoteControl(l,d,i),!0)}if(2===s.evt){var a=S(e,l,d,c);return a&&r.forEach(a,function(n,r){r._free&&r._free(),_(e,t,0)}),o&&o.onRemoteFreeControl&&o.onRemoteFreeControl(l,d,c),!0}}()){var f=S(e,l,d,c);if(n||f&&0!==f.length||y(e,t),f&&r.forEach(f,function(e,t){t._lastRecvTimestamp=(new Date).getTime()}),n){var p=e.current.__remoteControls[l.id];f=f||[],p&&f.push(p)}r.forEach(f,function(o,c){var u,d=0;if((u=s.mouse)&&u.length>0)try{r.forEach(u,function(e,t){t.sn>d&&(d=t.sn),t.oper===a.BTN.MOVE?c.mouseTrack&&c.mouseTrack.track(t.xy):c.mouseTrack&&c.mouseTrack.trigger(new a(t))})}catch(l){i.warn(l)}if((u=s.keyboard)&&u.length>0)try{r.forEach(u,function(e,t){t.sn>d&&(d=t.sn),c.keyboard&&(t.oper===a.BTN.KEYBOARD_DOWN?c.keyboard.onKeyDown(t.btn):t.oper===a.BTN.KEYBOARD_UP&&c.keyboard.onKeyUp(t.btn))})}catch(l){i.warn(l)}if(!0!==n)try{e.current.message({op:1001,tsxId:t.tsxId,memId:t.memId,arg:JSON.stringify({sn:d}),result:0}).post(function(e){i.debug("Send remote control response. the result = ",e.result,e.msg||"")})}catch(l){i.warn(l)}})}}function x(e,t,n){var o=t.sid,s=e.getStreamById(o);e.current.__remoteControls&&e.current.__remoteControls[o]&&w(e,v(e,s,{actions:[t]}),!0);var a=e.current.__pannelBuffers[o],c=a.getUnclearSize();if(a.put(t),c<emedia.config.allowSendWhenLessThan){!function t(){for(var c=a.getUnread(),u=0,d=0;c&&d<c.length;d++){var l=c[d];r.removeAttribute(l,"sid"),u<l.sn&&(u=l.sn)}c&&0!==c.length&&(i.debug(o,"buffer remain:",a.getUnclearSize(),", send evt:",c.length),e.current.postMessage(v(e,s,{actions:c,cId:a._cId}),function(e){if(-402!==e.result)if(-403!==e.result)if(-408!==e.result){if(-507===e.result||-405===e.result)return a.clearRead(u),void(n&&n.onNotAllowRemoteControl&&n.onNotAllowRemoteControl(s));0===e.result&&(a._lastRspTimestamp=(new Date).getTime());var c=e.arg;c&&(c=JSON.parse(c))&&!r.isInt(c.sn)?i.warn("rsp.sn not a Number.",c.sn,"for streamId",o):c&&void 0!==c.sn&&a.clearRead(c.sn),t()}else n&&n.onRemoteControlTimeout&&n.onRemoteControlTimeout(s);else n&&n.onBusy&&n.onBusy(s);else n&&n.onReject&&n.onReject(s)}))}()}}function C(e,t){var n,o=e.current.__pannelMouses&&r.removeAttribute(e.current.__pannelMouses,t),s=e.current.__pannelKeyboards&&r.removeAttribute(e.current.__pannelKeyboards,t);if(e.current.__pannelBuffers&&(n=r.removeAttribute(e.current.__pannelBuffers,t)),o&&o.ungrab(),s&&s.ungrab(),n){var a=e.getStreamById(t);if(n._callbacks&&n._callbacks.onDisControlled&&n._callbacks.onDisControlled(a),a){var c=e.current.newMessage({op:1002,memId:a.owner.id,arg:JSON.stringify({op2:30,streamId:a.id,evt:2,cId:n._cId}),_reqOps:[100230]});e.current.postMessage(c,function(e){0!==e.result&&i.warn("Unkown result：",e.result)})}}}function E(e,t,n,u,d,l){var f=Math.uuidFast();f=f.substr(f.length-6,6);var p=e.getStreamById(t);if(!p._webrtc)throw l&&l.onNotAllowRemoteControl&&l.onNotAllowRemoteControl(p),i.error("Not allow control. cause by the stream not sub"),"Not allow control. cause by the stream not sub";var h={op2:30,streamId:p.id,evt:1,cId:f},m=e.current.newMessage({op:1002,memId:p.owner.id,arg:JSON.stringify(h),_reqOps:[100230]});e.current.postMessage(m,function(h){if(-402!==h.result)if(-403!==h.result)if(-408!==h.result)if(-507!==h.result&&-405!==h.result){if(0===h.result)return function(e,t,n,u,d,l,f,p){void 0===d&&(d=n);var h=e.getStreamById(t),m=(e.current.__pannelMouses||(e.current.__pannelMouses={}))[t];m&&C(e,t);if(!h.located()&&!h.owner.acptOps[1003])throw i.error("which do not recv remote message, it is ",h.owner.memName),h.owner.memName+" do not recv remote message";m=new o({_target:d,_focused:!0,onMouseEnter:function(){(function(e,t,n,r,i){r&&r()}).call(m,e,t,n,l&&l.onMouseEnter,l),v&&v.grab()},onMouseExit:function(){(function(e,t,n,r,i){r&&r()}).call(m,e,t,n,l&&l.onMouseExit,l),v&&v.ungrab()},onMouseButton:function(i,o){!0===u&&(i.xy.x=-i.xy.x),function(e,t,n,i,o,s,a){i.xy=e.eventXYAtMedia(i.xy,n),i.xy&&(i.xy={x:i.xy.x/i.xy.width,y:i.xy.y/i.xy.height},r.extend(i,{sid:t}),x(e,i,a),s&&s(i,o))}.call(m,e,t,n,i,o,l&&l.onMouseButton,l)},onMouseMove:function(r,i){emedia.config.disableTrack||(!0===u&&(r.x=-r.x),function(e,t,n,r,i,o,s){var c=e.eventXYAtMedia(r,n);c&&(x(e,{xy:c={x:c.x/c.width,y:c.y/c.height},oper:a.BTN.MOVE,sid:t},s),o&&o(c,i))}.call(m,e,t,n,r,i,l&&l.onMouseMove,l))}});var v;(e.current.__pannelBuffers||(e.current.__pannelBuffers={}))[t]=new c({_cId:f,_callbacks:l,trackBufferSize:emedia.config.trackBufferSize||1e3});(e.current.__pannelMouses||(e.current.__pannelMouses={}))[t]=m,m.grab(),p&&(v=new s({_target:document,_focused:!0,onKeyPress:function(n,r){var i=r?a.BTN.KEYBOARD_DOWN:a.BTN.KEYBOARD_UP,o=n;(function(e,t,n,r,i,o){x(e,{oper:n,btn:r,sid:t},o),i&&i(n,r)}).call(v,e,t,i,o,l&&l.onKeyboard,l)}}),(e.current.__pannelKeyboards||(e.current.__pannelKeyboards={}))[t]=v)}(e,t,n,u,d,l,f,!0),void(l&&l.onAccept&&l.onAccept(p));i.warn("Unkown result：",h.result),l&&l.onNotAllowRemoteControl&&l.onNotAllowRemoteControl(p)}else l&&l.onNotAllowRemoteControl&&l.onNotAllowRemoteControl(p);else l&&l.onRemoteControlTimeout&&l.onRemoteControlTimeout(p);else l&&l.onBusy&&l.onBusy(p);else l&&l.onReject&&l.onReject(p)})}function T(e,t,n){var r=t;r&&(e.mouseTrack=r),e.keyboard=n}var I=function e(t){var n,o;(e.timeoutId&&clearTimeout(e.timeoutId),e.timeoutId=setTimeout(function(){e(t)},emedia.config.ctrlCheckIntervalMillis),t.current)&&((n=t.current.__remoteControls)&&r.forEach(n,function(e,t){if(void 0!==t.id&&e==t.id){var n=(new Date).getTime();t._lastRecvTimestamp&&n-t._lastRecvTimestamp>emedia.config.ctrlTimeoutMillis&&(i.warn("Timeout for remote controller. it is ",t.id,t._ctrlStream.id,t._controller.memName),t._free(),t._callbacks&&t._callbacks.onRemoteFreeControl&&t._callbacks.onRemoteFreeControl(t._ctrlStream,t._controller,t._cId))}}),(o=t.current.__pannelBuffers)&&r.forEach(o,function(e,n){var r=t.getStreamById(e);r&&!r.located()&&t.current.message({op:1002,memId:r.owner.id,arg:JSON.stringify({op2:30,streamId:r.id,evt:3,cId:n._cId}),_reqOps:[100230]}).post(function(e){})}))};e.exports={mirrorControlled:function(e,t,n,i){var o={};r.forEach(arguments,function(e,t){"function"==typeof t&&(o[t.name]=t)}),E(e,t,n,!0,i,o)},controlled:function(e,t,n,i){var o={};r.forEach(arguments,function(e,t){"function"==typeof t&&(o[t.name]=t)}),E(e,t,n,!1,i,o)},disControlled:C,controlling:T,graffiti:function(e,t,n,r){var i=new o({_target:e,_focused:!0,onMouseEnter:function(){},onMouseExit:function(){t.releaseTrigger()},onMouseButton:function(e,i){e.xy={x:e.xy.x/e.xy.width,y:e.xy.y/e.xy.height},!0===r&&(e.xy.x=-e.xy.x),n&&(e.xy=emedia.Service.prototype.eventXYAtMedia.call(null,e.xy,n)),e.xy&&t.trigger(e)},onMouseMove:function(e,i){e={x:e.x/e.width,y:e.y/e.height},!0===r&&(e.x=-e.x),n&&(e=emedia.Service.prototype.eventXYAtMedia.call(null,e,n)),e&&t.track(e)}});return i.grab(),i},echoControl:function(e,t,n,r){var i=e.getStreamById(t),o={_ctrlStream:i,_controller:i.owner,_service:e};T(o,n,r),(e.current.__remoteControls||(e.current.__remoteControls={}))[t]=o},disEchoControl:function(e,t){r.removeAttribute(e.current.__remoteControls,t)},support:function(e){var t={};r.forEach(arguments,function(e,n){0!=e&&"function"==typeof n&&(t[n.name]=n)}),h(e),l(e),u(e),m(e,t),I(e)},getController:function(e,t){var n=e.getStreamById(t),r=S(e,n);if(r&&0!==r.length)return r[0]._controller.memName}}},function(e,t,n){var r=n(15),i=(r.tagLogger("Mouse"),n(32));e.exports=r.prototypeExtend({__init__:function(){this._handlers=r.extend({mousedown:this._handleMouseDown.bind(this),mouseup:this._handleMouseUp.bind(this),mousemove:this._handleMouseMove.bind(this),mousewheel:this._handleMouseWheel.bind(this),mousedisable:this._handleMouseDisable.bind(this),mouseover:this._handleMouseOver.bind(this),mouseout:this._handleMouseOut.bind(this)},this._handlers||{})},onMouseButton:function(e,t){},onMouseMove:function(e,t){},onMouseEnter:function(){},onMouseExit:function(){},_onMouseButton:function(e,t,n){var r=(new Date).getTime(),o=new i({xy:e,oper:t,btn:n,_time:r});this.onMouseButton&&this.onMouseButton(o,this._lastTrigger),this._lastTrigger=o},_onMouseMove:function(e){this.onMouseMove&&this.onMouseMove(e,this._lastTrigger)},_captureMouse:function(){this._target.setCapture&&this._target.setCapture(),this._mouseCaptured=!0},_releaseMouse:function(){this._target.releaseCapture&&this._target.releaseCapture(),this._mouseCaptured=!1},_resetDoubleClickTimer:function(){this._doubleClickTimer=null},_handleMouseOver:function(e){!1!==this._mouseExit&&(this._mouseExit=!1,this.onMouseEnter&&this.onMouseEnter())},_handleMouseOut:function(e){!0!==this._mouseExit&&(this._mouseExit=!0,this.onMouseExit&&this.onMouseExit()),this._lastTrigger=void 0},_handleMouseDown:function(e){this._captureMouse(),this._handleMouseButton(e,i.BTN.KEY_DOWN)},_handleMouseUp:function(e){this._mouseCaptured&&(this._handleMouseButton(e,i.BTN.KEY_UP),this._releaseMouse())},_handleMouseWheel:function(e){if(this._focused){e=e||window.event;var t=r.getEventElementXY(e,this._target,this._scale),n=(e.detail?-1*e.detail:e.wheelDelta/40)>0?i.BTN.WHEEL_ROLL_UP:i.BTN.WHEEL_ROLL_DOWN;this._onMouseButton(t,i.BTN.KEY_DOWN,n),r.stopEvent(e)}},_handleMouseMove:function(e){if(this._focused){e=e||window.event;var t=r.getEventElementXY(e,this._target,this._scale);this._onMouseMove(t),r.stopEvent(e)}},_handleMouseDisable:function(e){if(this._focused){e=e||window.event;var t=r.getEventElementXY(e,this._target,this._scale);try{return!(t.realX>=0&&t.realY>=0&&t.realX<this._target.offsetWidth&&t.realY<this._target.offsetHeight)}finally{r.stopEvent(e)}}},_handleMouseButton:function(e,t){if(this._focused){e=e||window.event;var n,o=r.getEventElementXY(e,this._target,this._scale);if(e.touches||e.changedTouches){if(t==i.BTN.KEY_DOWN){if(null===this._doubleClickTimer)this._lastTouchPos=o;else{clearTimeout(this._doubleClickTimer);var s=this._lastTouchPos.x-o.x,a=this._lastTouchPos.y-o.y;Math.sqrt(s*s+a*a)<20*window.devicePixelRatio&&(o=this._lastTouchPos)}this._doubleClickTimer=setTimeout(this._resetDoubleClickTimer.bind(this),500)}n=i.BTN.LEFT}else n=e.which?1<<e.button:(1&e.button)+2*(2&e.button)+(4&e.button)/2;this._onMouseButton(o,t,n),r.stopEvent(e)}},grab:function(){var e=this._target;r.addEvent(e,"mouseover",this._handlers.mouseover),r.addEvent(e,"mouseout",this._handlers.mouseout),r.addEvent(e,"touchstart",this._handlers.mousedown),r.addEvent(e,"touchend",this._handlers.mouseup),r.addEvent(e,"touchmove",this._handlers.mousemove),r.addEvent(e,"mousedown",this._handlers.mousedown),r.addEvent(e,"mouseup",this._handlers.mouseup),r.addEvent(e,"mousemove",this._handlers.mousemove),r.addEvent(e,r.layoutEngine.gecko?"DOMMouseScroll":"mousewheel",this._handlers.mousewheel),r.addEvent(e,"contextmenu",this._handlers.mousedisable)},ungrab:function(){var e=this._target;r.removeEvent(e,"mouseover",this._handlers.mouseover),r.removeEvent(e,"mouseout",this._handlers.mouseout),r.removeEvent(e,"touchstart",this._handlers.mousedown),r.removeEvent(e,"touchend",this._handlers.mouseup),r.removeEvent(e,"touchmove",this._handlers.mousemove),r.removeEvent(e,"mousedown",this._handlers.mousedown),r.removeEvent(e,"mouseup",this._handlers.mouseup),r.removeEvent(e,"mousemove",this._handlers.mousemove),r.removeEvent(e,r.layoutEngine.gecko?"DOMMouseScroll":"mousewheel",this._handlers.mousewheel),r.removeEvent(e,"contextmenu",this._handlers.mousedisable)}})},function(e,t,n){var r=n(15),i=r.tagLogger("Keyboard");e.exports=r.prototypeExtend({__init__:function(){this._eventHandlers={keyup:this._handleKeyUp.bind(this),keydown:this._handleKeyDown.bind(this),keypress:this._handleKeyPress.bind(this),blur:this._allKeysUp.bind(this)}},getKey:function(e){return"keyCode"in e&&"key"in e?e.key+":"+e.keyCode:"keyCode"in e?e.keyCode:e.key},onKeyPress:function(e,t){},_onKeyPress:function(e,t){this.onKeyPress&&this.onKeyPress(e,t)},_handleRfbEvent:function(e,t){e.shiftKey,e.ctrlKey,e.altKey;var n=e.keyCode||e.which;this._onKeyPress(n,"keydown"==t)},_handleKeyDown:function(e){return!this._focused||!this._handleRfbEvent(e,"keydown")||(r.stopEvent(e),!1)},_handleKeyPress:function(e){return!this._focused||(r.stopEvent(e),!1)},_handleKeyUp:function(e){return!this._focused||!this._handleRfbEvent(e,"keyup")||(r.stopEvent(e),!1)},_allKeysUp:function(){},sync:function(e){},grab:function(){var e=this._target;r.addEvent(e,"keydown",this._eventHandlers.keydown),r.addEvent(e,"keyup",this._eventHandlers.keyup),r.addEvent(e,"keypress",this._eventHandlers.keypress),r.addEvent(e,"blur",this._eventHandlers.blur),i.info("keyboard grab at element")},ungrab:function(){var e=this._target;r.removeEvent(e,"keydown",this._eventHandlers.keydown),r.removeEvent(e,"keyup",this._eventHandlers.keyup),r.removeEvent(e,"keypress",this._eventHandlers.keypress),r.removeEvent(e,"blur",this._eventHandlers.blur),this._allKeysUp(),i.info("keyboard upgrab at element")}})},function(e,t,n){var r=n(15),i=(r.tagLogger("TotalBuffer"),n(240)),o=n(241),s=n(32);e.exports=r.prototypeExtend({trackBufferSize:100,_trackBufferCompRadio:.25,_sn:1,__init__:function(){this._eventBuffer=new i({_nextsn:this._nextsn.bind(this)}),this._trackBuffer=new o({_nextsn:this._nextsn.bind(this),_compRadio:this._trackBufferCompRadio,mouseTrackBufferSize:this.trackBufferSize})},_nextsn:function(){return this._sn++},put:function(e){e&&void 0!==e.oper&&(e.oper===s.BTN.MOVE?this._trackBuffer.put(e):this._eventBuffer.put(e))},getUnread1:function(e){function t(e,t){return e._time-t.time}var n;if(!e){var r=this._eventBuffer.getUnread(),i=this._trackBuffer.getUnread();return Array.prototype.push.apply(r,i),(n=r).sort(t),n}n=[];r=this._eventBuffer._getUnread(e),i=this._trackBuffer._getUnread(e);Array.prototype.push.apply(n,r),Array.prototype.push.apply(n,i),n.sort(t),n=n.slice(0,e>n.length?n.length:e);for(var o=0;o<n.length;o++)n[o].oper===s.BTN.MOVE?this._trackBuffer.getUnread(1):this._eventBuffer.getUnread(1);return n},getUnread:function(e){e||(e=this._eventBuffer.getUnreadSize()+this._trackBuffer.getUnreadSize());for(var t=[];t.length!==e;){var n=this._eventBuffer._getUnread(1),r=this._trackBuffer._getUnread(1);if(void 0===n&&r)t.push(this._trackBuffer.getUnread(1));else if(void 0===r&&n)t.push(this._eventBuffer.getUnread(1));else{if(void 0===r&&void 0===n)return t;n.sn<r.sn?t.push(this._eventBuffer.getUnread(1)):t.push(this._trackBuffer.getUnread(1))}}return t},getUnreadSize:function(){return this._trackBuffer.getUnreadSize()+this._eventBuffer.getUnreadSize()},getUnclearSize:function(){return this._trackBuffer.getUnclearSize()+this._eventBuffer.getUnclearSize()},clearRead:function(e){return this._eventBuffer.clearRead(e)+this._trackBuffer.clearRead(e)}})},function(e,t,n){var r=n(15);r.tagLogger("EventBuffer");e.exports=r.prototypeExtend({_buffer:[],_sn:1,_beginIndex:0,_readIndex:0,_endIndex:0,_nextsn:function(){return this._sn++},put:function(e){e&&(e.sn=this._nextsn(),this._buffer.push(e),this._endIndex++)},_getUnread:function(e){return this._readIndex===this._endIndex?1===e?void 0:[]:this._buffer[this._readIndex]},getUnread:function(e){var t;try{return t=this._getUnread(e)}finally{t&&(this._readIndex+=1===e?1:t.length)}},getUnreadSize:function(){return this._endIndex-this._readIndex},getUnclearSize:function(){return this._readIndex-this._beginIndex},clearRead:function(e){if(this._readIndex!==this._beginIndex){for(var t=0,n=this._beginIndex;n<this._readIndex&&this._buffer[n].sn<=e;n++)t++;if(0===t)return 0;for(n=0;n<t;n++)this._buffer.shift();return this._beginIndex=0,this._readIndex-=t,this._endIndex-=t,t}}})},function(e,t,n){var r=n(15);r.tagLogger("TrackBuffer");e.exports=r.prototypeExtend({mouseTrackBufferSize:1e3,_sn:1,_compRadio:.25,_beginIndex:0,_readIndex:0,_endIndex:0,__init__:function(){this._mouseTrackBuffer=new Array(this.mouseTrackBufferSize)},_nextsn:function(){return this._sn++},_index:function(e){return e%this.mouseTrackBufferSize},comp1:function(e){if(!(e>=1)){for(var t=Math.floor(1/e),n=this._beginIndex,r=n+1;n<this._endIndex;){for(var i=2;i<t&&n+i<this._endIndex;i++)this._mouseTrackBuffer[this._index(r++)]=this._mouseTrackBuffer[this._index(n+i)];n+=t}this._endIndex=r}},put1:function(e){if(e){e.sn=this._nextsn(),this._endIndex-this._readIndex===this.mouseTrackBufferSize&&(this.comp1(this._compRadio),this._readIndex=this._beginIndex);var t=this._index(this._beginIndex),n=(this._index(this._readIndex),this._index(this._endIndex));n<=t&&n>=0&&this._endIndex>this._beginIndex&&this._beginIndex++,this._mouseTrackBuffer[n]=e,this._endIndex++}},compHalfOfUnread:function(){for(var e=this._readIndex+2,t=this._readIndex+1;e<this._endIndex;)this._mouseTrackBuffer[this._index(t++)]=this._mouseTrackBuffer[this._index(e)],e+=2;this._endIndex=t},put:function(e){if(e){e.sn=this._nextsn(),this._endIndex-this._beginIndex===this.mouseTrackBufferSize&&this.compHalfOfUnread();var t=this._index(this._endIndex);this._mouseTrackBuffer[t]=e,this._endIndex++}},_interval:function(e,t){var n=this._index(e),r=this._index(t);if(n<r)return this._mouseTrackBuffer.slice(n,r);var i=this._mouseTrackBuffer.slice(n);return Array.prototype.push.apply(i,this._mouseTrackBuffer.slice(0,r)),i},_getUnread:function(e){return this._readIndex===this._endIndex?1===e?void 0:[]:this._mouseTrackBuffer[this._index(this._readIndex)]},getUnread:function(e){var t;try{return t=this._getUnread(e)}finally{t&&(this._readIndex+=1===e?1:t.length)}},getUnreadSize:function(){return this._endIndex-this._readIndex},getUnclearSize:function(){return this._readIndex-this._beginIndex},clearRead:function(e){if(this._readIndex!==this._beginIndex){for(var t=0,n=this._beginIndex;n<this._readIndex;n++){var r=this._index(n);if(!(this._mouseTrackBuffer[r].sn<=e))break;this._beginIndex++,t++}return t}}})},function(e,t,n){var r=n(15),i=r.tagLogger("CompositeCanvas");function o(){}for(var s in CanvasRenderingContext2D.prototype)!function(e){o.prototype[e]=function(){if("function"==typeof this._canvasContext[e])this._canvasContext[e].apply(this._canvasContext,arguments);else{var t=arguments.length>=1?arguments[0]:void 0;if(!t)return this._canvasContext[e];this._canvasContext[e]=t}}}(s);var a=r.prototypeExtend(o,{__init__:function(){this.compositeCanvasTag||(this.compositeCanvasTag=document.createElement("canvas")),this._canvasContext=this.compositeCanvasTag.getContext("2d"),this._canvasContext.globalAlpha=void 0!==this._globalAlpha?this._globalAlpha:1,this._compositeOperation=this._compositeOperation||c.source_over,this.globalCompositeOperation(this._compositeOperation)},setCanvas:function(){for(var e,t=this,n=0;n<arguments.length;n++)"function"==typeof(e=arguments[n])&&e(this.compositeCanvasTag,this._canvasContext),"function"!=typeof e&&r.isPlainObject(e)&&r.forEach(e,function(e,n){i.debug("Canvas set ",e," = ",n),t.compositeCanvasTag.setAttribute(e,n)});return t},getCanvasImageData:function(e,t){for(var n=[],r=1;r<arguments.length;r++)n.push(arguments[r]);var i=e.getContext("2d");return i.globalAlpha=t||0,i.getImageData.apply(i,n)},_composite:function(e){return new a(this,{_compositeOperation:e})},composite:function(e){return this.globalCompositeOperation(e),this},requestAnimationFrame:function(e){var t=this;return t.requestFrame(),t._requestAnimationFrameStart=window.requestAnimationFrame(function(e){t.requestAnimationFrame(e)}),t},cancelAnimationFrame:function(){return this._requestAnimationFrameStart&&window.cancelAnimationFrame(this._requestAnimationFrameStart),this},requestFrame:function(e){var t;if("function"!=typeof this.requestOneFrame)throw i.error("Pleas implement requestOneFrame()"),"Pleas implement requestOneFrame()";try{this.requestOneFrame()}catch(r){i.error(r)}if(e&&(t=Math.floor(1e3/e)),!t)return this;var n=this.requestFrame.bind(this);return this.intervalId=setInterval(function(){n(e)},t),this},stopRequestFrame:function(){return this.intervalId&&clearInterval(this.intervalId),this}});a.CompositeOperation=["source-atop","source-in","source-out","source-over","destination-atop","destination-in","destination-out","destination-over","lighter","darker","xor","copy"];var c=a.operation={source_atop:"source-atop",source_in:"source-in",source_out:"source-out",source_over:"source-over",destination_atop:"destination-atop",destination_in:"destination-in",destination_out:"destination-out",destination_over:"destination-over",lighter:"lighter",darker:"darker",xor:"xor",copy:"copy"};a.compositeVideoOverCanvas=function(e,t,n){var r;return(r=e.compositeCanvas)||(r=new a({compositeCanvasTag:e,requestOneFrame:function(){t&&r.drawImage(t,0,0,e.width,e.height),n&&r.drawImage(n,0,0,e.width,e.height)}}),e.compositeCanvas=r),r},e.exports=a},function(e,t,n){var r=n(15);r.tagLogger("Keyboard");e.exports=r.prototypeExtend({onKeyDown:function(e){},onKeyUp:function(e){}})},function(e,t,n){var r,i=n(15),o=i.tagLogger("PCStats");e.exports=r=i.prototypeExtend({__init__:function(){this._webrtc||this._stream&&(this._webrtc=this._stream._webrtc),this.samplesDatas={},this.gatherResults={},this._bysamples={},!1!==this._inbound_&&(this._bysamples["inbound-rtp"]=["bytesReceived","packetsLost","packetsReceived","packageLossRate"]),!1!==this._outbound_&&(this._bysamples["outbound-rtp"]=["bytesSent"])},onGatherResult:function(e,t,n,r){o.info(e,t,n,r)},stats:function(e){return this._webrtc&&this._webrtc._rtcPeerConnection||o.warn("not found webrtc or peer connection").return,this._webrtc._rtcPeerConnection.getStats(e)},statsOfTrack:function(e){if(!e instanceof window.MediaStreamTrack)throw o.error("selector not a MediaStreamTrack"),"selector not a MediaStreamTrack";return this.stats(e)},audioTrack:function(e){var t=e&&e.getAudioTracks();return t&&t.length?t[0]:void 0},videoTrack:function(e){var t=e&&e.getVideoTracks();return t&&t.length?t[0]:void 0},gatherTrack:function(e,t){var n=this;t=(t=e.kind||t)&&t.toLowerCase();var r=e.id;this.statsOfTrack(e).then(function(i){n.samplesDatas[r]||(n.samplesDatas[r]={});var s=n.samplesDatas[r];i.forEach(function(r,i){var a=n._bysamples[r.type],c=r.mediaType||i.indexOf("ideo")>=0&&"video"||i.indexOf("udio")>=0&&"audio"||void 0;if(a&&a.length&&(!0===emedia.config._printDebugStats&&o.debug(i,r,e,c,t),!c||c===t)){var u=s[r.type]||(s[r.type]={});a.forEach(function(n){var i=u[n]||(u[n]=[]),o={timestamp:r.timestamp,kind:r.mediaType||e.kind||t};o[n]="packageLossRate"===n?{packetsLost:r.packetsLost,packetsReceived:r.packetsReceived}:r[n],i.push(o)})}})})},gatherWebrtcMediaStream:function(e,t){var n=this;t?"audio"!==t.toLowerCase()?"video"!==t.toLowerCase()||e.getVideoTracks().forEach(function(e){n.gatherTrack(e,e.kind||t.toLowerCase())}):e.getAudioTracks().forEach(function(e){n.gatherTrack(e,e.kind||t.toLowerCase())}):e.getTracks().forEach(function(e){n.gatherTrack(e)})},gatherWebrtc:function(){this._webrtc._localStream&&this.gatherWebrtcMediaStream(this._webrtc._localStream),this._webrtc._remoteStream&&this.gatherWebrtcMediaStream(this._webrtc._remoteStream)},_gather_inbound_rtp_pliCount:function(e){var t=e.shift();return t&&t.pliCount||0},_gather_inbound_rtp_packetsLost:function(e){var t=e.shift();return t&&t.packetsLost||0},_gather_inbound_rtp_packetsReceived:function(e){var t=e.shift();return t&&t.packetsReceived||0},_gather_inbound_rtp_packageLossRate:function(e){if(!e||0===e.length)return 0;var t,n=e[e.length-1];return e.length<emedia.config.statsSeconds?0:(t=e.shift(),(n.packageLossRate.packetsLost-t.packageLossRate.packetsLost)/(n.packageLossRate.packetsReceived-t.packageLossRate.packetsReceived))},_gather:function(e,t,n){e=e.replace(/[^\w]/g,"_"),t=t.replace(/[^\w]/g,"_");var r=i.list("_gather",e,t).join("_");if("function"==typeof this[r])return this[r](n);var o=emedia.config.statsSeconds;if(n.length<o)return 0;var s=n[o-1][t]-n[0][t],a=n[o-1].timestamp-n[0].timestamp;return n.shift(),0===a?0:parseFloat(1e3*s/a).toFixed(2)},_statsCount:function(){var e=this;i.forEach(e.samplesDatas,function(t,n){!function(t,n,r){i.forEach(r,function(r,o){var s=n[r]||(n[r]={});!function(t,n,r,o){i.forEach(o,function(i,o){var s=n[i]=e._gather(r,i,o);e.onGatherResult(t,r,i,s)})}(t,s,r,o)})}(t,e.gatherResults[t]=e.gatherResults[t]||{},n)})},gather:function(){this.gatherWebrtc(),this._statsCount()},intervalGather:function(e){this._intervalId&&clearInterval(this._intervalId),this._intervalId=setInterval(this.gather.bind(this),e||1e3)},stopIntervalGather:function(){this._intervalId&&clearInterval(this._intervalId)}});var s={},a=r.echo=function(e){i.forEach(e,function(e,t){var n;!s[t.id]&&t._webrtc&&!t._webrtc.closed&&t.getMediaStream()?(s[t.id]=n=new r({_webrtc:t._webrtc}),n._mediaStream=t.getMediaStream()):!s[t.id]||t._webrtc&&!t._webrtc.closed&&t.getMediaStream()||i.removeAttribute(s,t.id)});var t=[];i.forEach(s,function(n,r){e&&e[n]?(r.gatherWebrtcMediaStream(r._mediaStream),r._statsCount()):t.push(n)}),i.forEach(t,function(e,t){i.removeAttribute(s,t)})};r.intervalEcho=function(e,t){return setInterval(function(){a(e)},t)},i.forEach(["inbound","outbound"],function(e,t){i.forEach(["Audio","Video"],function(e,n){!function(e,t){var n;r[e+t]=n=function(o,s,a){n.__intervalIds||(n.__intervalIds={});var c=n.__intervalIds&&n.__intervalIds[o.id];return c&&clearInterval(c),c=setInterval(function(){var a,u=n[o.id];(!u&&o&&o._webrtc&&!o._webrtc.closed&&o.getMediaStream()?(n[o.id]=u=new r({_webrtc:o._webrtc,_inbound_:"inbound"===e,_outbound_:"outbound"===e}),s&&(u.onGatherResult=s),u._mediaStream=o.getMediaStream()):!u||o&&o._webrtc&&!o._webrtc.closed&&o._webrtc.__id===u._webrtc.__id&&o.getMediaStream()&&u._mediaStream&&u._mediaStream.id===o.getMediaStream().id||(i.removeAttribute(n,o.id),u=null),u)?(u.gatherWebrtcMediaStream(u._mediaStream,t),u._statsCount()):o&&emedia.__easemob_current_mservice&&(a=emedia.__easemob_current_mservice.getStreamById(o.id))?o=a:c&&clearInterval(c)},a),n.__intervalIds[o.id]=c,c}}(t,n)})})},function(e,t,n){window.emedia=window.emedia||{};var r=n(15).tagLogger("electron");emedia.electron=window.require("electron"),emedia.chooseElectronDesktopMedia=function(e,t,n){r.info("Choose desktop. ",e[0]),t(e[0])}}])}),window._emediaVersion="2.1.1_Git.29f2187",console&&console.warn("EMedia version","2.1.1_Git.29f2187");
        },{}],"yUjP":[function(require,module,exports) {
            "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("easemob-emedia"),t=e.util;exports.default=t;
        },{"easemob-emedia":"WNWS"}],"thlH":[function(require,module,exports) {
            function t(a){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(a)}var a=require("./utils").default,e=a.logger,n={rtFlag:1,success:function(t){},fail:function(t){}},d=function t(e){if(!(this instanceof t)){var d=function(t){a.extend(!0,this,t||{})};return a.extend(!0,d.prototype,n,e||{}),d}a.extend(!0,this,n,e||{})};exports.RouteTo=d;var s={imConnection:null,rtcHandler:null,events:{0:"onReqP2P",1:"onNewCfr",2:"onDelCfr",3:"onReqTkt",100:"onPing",101:"onPong",102:"onInitC",103:"onReqC",104:"onAcptC",105:"onTcklC",106:"onAnsC",107:"onTermC",202:"onInvite",300:"onEvEnter",301:"onEvExit",302:"onEvPub",303:"onEvUnpub",304:"onEvMems",204:"onEvClose",400:"onStreamControl",401:"onEvJoin",onServerError:"onServerError"},register:function(a){if("object"===t(a))for(var e in a)this.bind(e,a[e])},bind:function(t,a){var e;(e=this.events[t])?this[e]=a:this[e=this.events[t]="on_"+t]=a},jid:function(t){return/^.+#.+_.+@.+$/g.test(t)?t:this.imConnection.context.appKey+"_"+t+"@"+this.imConnection.domain},reqP2P:function(t,a,n,d,s){e.debug("req p2p ...");var r={data:{op:0,video:a,audio:n,peer:d}};this.rtcHandler.sendRtcMessage(t,r,s)},newCfr:function(t,a,n,d){e.debug("newCfr ...");var s={data:{op:1}};a&&(s.data.reqTkt=a),n&&(s.data.password=n),this.rtcHandler.sendRtcMessage(t,s,d)},enter:function(t,a,n,d,s,r,o){e.debug("enter ...");var i={data:{op:200}};a&&(i.data.WebRTCId=a),n&&(i.data.reqMembers=n),d&&(i.data.tkt=d),s&&(i.data.nonce=s),r&&(i.data.digest=r),this.rtcHandler.sendRtcMessage(t,i,o)},ping:function(t,a,n){e.debug("ping ...");var d={data:{op:100}};a&&(d.data.sessId=a),this.rtcHandler.sendRtcMessage(t,d,n)},streamControl:function(t,a,n,d,s,r){e.debug("streamControl ...");var o={data:{op:400}},i=0==d||3==d;0==d||1==d?emedia.enableAudioTracks(s,i):emedia.enableVideoTracks(s,i),a&&(o.data.sessId=a),n&&(o.data.rtcId=n),void 0!==d&&null!=d&&(o.data.controlType=d),this.rtcHandler.sendRtcMessage(t,o,r)},reqTkt:function(t,a,n,d,s){e.debug("reqTkt ...");var r={data:{op:3}};a&&(r.data.isCreate=a),n&&(r.data.confrId=n),"string"==typeof d&&(r.data.password=d),this.rtcHandler.sendRtcMessage(t,r,s)},invite:function(t,a,n,d,s){e.debug("reqTkt ...");var r={data:{op:202}};a&&(r.data.confrId=a),"string"==typeof n&&(r.data.password=n),d&&(r.data.gid=d),this.rtcHandler.sendRtcMessage(t,r,s)},initC:function(t,a,n,d,s,r,o,i,c,u,l,p,f){e.debug("initC ..."),t.to=t.to.split("_")[1].split("@")[0];var g={data:{op:102}};g.streamType=a||"VIDEO",n&&(g.data.WebRTCId=n),d&&(g.data.tkt=d),s&&(g.data.sessId=s),r&&(g.data.rtcId=r),o&&(g.data.pubS=o),i&&(g.data.subS=i),c&&(g.data.sdp=c),u&&(g.data.cands=u),l&&(g.data.rtcCfg=l),p&&(g.data.WebRTC=p),g.data.expr=emedia.supportPRAnswer?1:0,this.rtcHandler.sendRtcMessage(t,g,f)},tcklC:function(t,a,n,d,s,r){e.debug("tcklC ...");var o={data:{op:105}};a&&(o.data.sessId=a),n&&(o.data.rtcId=n),d&&(o.data.sdp=d),s&&(o.data.cands=s),this.rtcHandler.sendRtcMessage(t,o,r)},ansC:function(t,a,n,d,s,r,o,i){e.debug("ansC ...");var c={data:{op:106}};a&&(c.data.sessId=a),n&&(c.data.rtcId=n),d&&(c.data.sdp=d),s&&(c.data.cands=s),!1===o&&(c.data.enableVoice=o),!1===i&&(c.data.enableVideo=i),this.rtcHandler.sendRtcMessage(t,c,r)},acptC:function(t,a,n,d,s,r,o,i,c){e.debug("acptC ...");var u={data:{op:104}};a&&(u.data.sessId=a),n&&(u.data.rtcId=n),d&&(u.data.sdp=d),s&&(u.data.cands=s),r&&(u.data.ans=r),!1===i&&(u.data.enableVoice=i),!1===c&&(u.data.enableVideo=c),this.rtcHandler.sendRtcMessage(t,u,o)},getMems:function(t,a,n,d){e.debug("getMems ...");var s={data:{op:203}};a&&(s.data.WebRTCId=a),n&&(s.data.sessId=n),this.rtcHandler.sendRtcMessage(t,s,d)},subC:function(t,a,n,d,s){e.debug("subC ...");var r={data:{op:205}};a&&(r.data.sessId=a),n&&(r.data.rtcId=n),d&&(r.data.subS=d),this.rtcHandler.sendRtcMessage(t,r,s)},usubC:function(t,a,n,d){e.debug("usubC ...");var s={data:{op:206}};a&&(s.data.sessId=a),n&&(s.data.rtcId=n),this.rtcHandler.sendRtcMessage(t,s,d)},termC:function(t,a,n,d,s){e.debug("termC ...");var r={data:{op:107,reason:d}};a&&(r.data.sessId=a),n&&(r.data.rtcId=n),d&&(r.reason=d),this.rtcHandler.sendRtcMessage(t,r,s)},exit:function(t,a,n,d){e.debug("exit ...");var s={data:{op:201}};a&&(s.data.WebRTCId=a),n&&(s.data.sessId=n),this.rtcHandler.sendRtcMessage(t,s,d)},delCfr:function(t,a,n,d){e.debug("delCfr ...");var s={data:{op:2}};a&&(s.data.WebRTCId=a),n&&(s.data.admtok=n),this.rtcHandler.sendRtcMessage(t,s,d)}};exports.Api=function(t){var n=this;a.extend(!0,this,s,t||{}),this.rtcHandler.onRecvRtcMessage=function(t,a,d,s,r){var o;0!=a.result&&n.onServerError?n.onServerError.call(n,t,a,d,s,r):n.events[a.op]&&(o=n[n.events[a.op]])?o.call(n,t,a,d,s,r):e.info("can not handle(recvRtcMessage) the op: "+a.op,a)}};
        },{"./utils":"yUjP"}],"7BK3":[function(require,module,exports) {
            var e=require("./utils").default,t=e.logger,n=require("./api"),o=n.RouteTo,s="urn:xmpp:media-conference",d={_apiCallbacks:{},imConnection:null,_connectedSid:"",init:function(){var e=this;e.imConnection.registerConfrIQHandler=function(n,o,s){try{e.handleRtcMessage(n)}catch(d){t.error(d)}}},handleRtcMessage:function(n,s,d){var a=this;if(n){var i=WebIM.conn.context.root.lookup("easemob.pb.ConferenceBody").decode(n.payload);console.log("%c"+JSON.stringify(i),"color: blue");n.id;var r=n.from.name||"";r.lastIndexOf("/")>=0&&(r=r.substring(0,r.lastIndexOf("/")));var c=i.routeKey,p=i.sessionId;(a._fromSessionID||(a._fromSessionID={}))[r]=p;var f=e.parseJSON(i.content),l=f,y=1==i.type?"VIDEO":"VOICE";""==y&&(y="VOICE"),l.streamType=y,102==l.op&&(a.singalStreamType=y);var g=f.tsxId;if(a.ctx=f.ctx,t.debug("Recv [op = "+l.op+"] [tsxId="+g+"]\r\n json :",n),""!=a._connectedSid||0!=l.result&&102!=l.op&&202!=l.op){if(a._connectedSid!=p){if(t.debug("Error recv [op = "+l.op+"] [tsxId="+g+"]. caused by _connectedSid != fromSessionId :",a._connectedSid,p),102==l.op&&p&&a._connectedSid){var m=new o({to:r,rtKey:c,sid:p,success:function(e){t.debug("iq to server success",e)},fail:function(e){t.debug("iq to server error",e),a.onError(e)}}),u={data:{op:107,sessId:l.sessId,rtcId:l.rtcId,reason:"busy"},reason:"busy"};a.sendRtcMessage(m,u)}return}}else a._connectedSid=p;if(107==l.op){a._connectedSid="",_fromSessionID={};var v=i.endReason;l.reason=null!=v&&{0:"hangup",1:"noresponse",2:"reject",3:"busy",4:"fail",5:"unsupported",6:"offline"}[v]}if(l.sdp&&("string"==typeof l.sdp&&(l.sdp=e.parseJSON(l.sdp)),l.sdp.type&&(l.sdp.type=l.sdp.type.toLowerCase())),l.cands){"string"==typeof l.cands&&(l.cands=e.parseJSON(l.cands));for(var I=0;I<l.cands.length;I++){if("string"==typeof l.cands[I])try{l.cands[I]=e.parseJSON(l.cands[I])}catch(S){l.cands[I]={candidate:l.cands[I]}}l.cands[I].sdpMLineIndex=void 0!==l.cands[I].sdpMLineIndex?l.cands[I].sdpMLineIndex:l.cands[I].mlineindex,l.cands[I].sdpMid=void 0!==l.cands[I].sdpMid?l.cands[I].sdpMid:l.cands[I].mid,delete l.cands[I].mlineindex,delete l.cands[I].mid}}if(l.rtcCfg&&"string"==typeof l.rtcCfg&&(l.rtcCfg=e.parseJSON(l.rtcCfg)),l.rtcCfg2&&"string"==typeof l.rtcCfg2&&(l.rtcCfg2=e.parseJSON(l.rtcCfg2)),l.WebRTC&&"string"==typeof l.WebRTC&&(l.WebRTC=e.parseJSON(l.WebRTC)),l.confrId&&(l.conferenceId=l.confrId),g&&a._apiCallbacks[g])try{a._apiCallbacks[g].callback&&a._apiCallbacks[g].callback(r,l)}catch(b){throw b}finally{delete a._apiCallbacks[g]}else a.onRecvRtcMessage(r,l,c,g,p);return!0}},onRecvRtcMessage:function(n,o,s,d,a){t.debug(" form : "+n+" \r\n json :"+e.stringifyJSON(rtcJSON))},convertRtcOptions:function(t){var n=t.data.sdp;n&&((n={type:n.type,sdp:n.sdp}).type=n.type.toUpperCase(),n=e.stringifyJSON(n),t.data.sdp=n);var o=t.data.cands;if(o){if(e.isArray(o));else{var s=[];s.push(o),o=s}for(var d in o){var a=o[d];if(void 0!==a.candidate&&void 0!==a.sdpMLineIndex&&void 0!==a.sdpMid){var i={type:"candidate",candidate:a.candidate,mlineindex:a.sdpMLineIndex,mid:a.sdpMid};o[d]=e.stringifyJSON(i)}}t.data.cands=o}var r=t.data.rtcCfg;r&&"string"!=typeof r&&(t.data.rtcCfg=e.stringifyJSON(r));var c=t.data.WebRTC;c&&"string"!=typeof c&&(t.data.WebRTC=e.stringifyJSON(c))},getShortId:function(e){var t,n;return(t=e.indexOf("_")+1)<1&&(t=0),(n=e.indexOf("@",-1))<0&&(n=e.length),e.substring(t,n)},sendRtcMessage:function(t,n,o){var s=this.imConnection,d=s.getUniqueId(),a=t.to&&t.to||s.domain;a.indexOf("@")>=0&&(a=a.split("_")[1].split("@")[0],""==this._connectedSid&&102==n.data.op&&(this._connectedSid=i));var i=t.sid||this._fromSessionID&&this._fromSessionID[a];i=i||((this._fromSessionID||(this._fromSessionID={}))[a]=s.getUniqueId("CONFR_")),(this._fromSessionID||(this._fromSessionID={}))[a]=i;var r=t.rtKey||t.rtkey;r||(r="");var c=t.rtflag;!isNaN(c)||(c=1),n.data||(n.data={}),n.data.tsxId=d,this.ctx&&(n.data.ctx=this.ctx),this.convertRtcOptions(n);var p=n.streamType||this.singalStreamType||"VIDEO";102==n.data.op&&(this.singalStreamType=p);var f=t.id||s.getUniqueId("CONFR_");o&&(this._apiCallbacks[d]={callback:o});var l={id:f,to:a,from:s.context.jid,type:"VIDEO"==p?1:0,rtflag:c,stream_type:p,sid:i,content:n.data,reason:n.reason,rtKey:r};if(202!=n.data.op&&this._sendMessage(l,WebIM.conn),107==n.data.op&&this._connectedSid&&(t.sid&&this._connectedSid!=t.sid||(this._connectedSid="",this._fromSessionID={})),202==n.data.op){var y=e.list("Invite",this.getShortId(a),"join conference:",n.data.confrId).join(" "),g={msg:y,id:f=s.getUniqueId("CONFR_INVITE"),to:a,from:s.context.jid,contents:[{contenttype:"TEXT",text:y}],gid:n.data.gid,password:n.data.password,exts:{key:"conferenceId",type:7,value:n.data.confrId}};return this._sendGroupInviteMsg(g,WebIM.conn)}},_sendGroupInviteMsg:function(e,t){var n=[],o=t.context.root.lookup("easemob.pb.MessageBody.Content").decode(n);o.type=0,o.text=e.msg;var s=t.context.root.lookup("easemob.pb.MessageBody"),d=s.decode(n);d.from={name:e.from.name},d.to={name:e.to},d.contents=[o];var a=t.context.root.lookup("easemob.pb.KeyValue"),i=a.decode(n),r=a.decode(n),c=a.decode(n);i.key="conferenceId",i.type=7,i.stringValue=e.exts.value,r.key="msg_extension",r.type=7,r.stringValue=JSON.stringify({inviter:e.from.name,group_id:e.gid}),c.key="password",c.type=7,c.stringValue=e.password,d.ext=[i,r,c],d.type=1,d=s.encode(d).finish();var p=t.context.root.lookup("easemob.pb.Meta").decode(n);p.id=e.id,p.from=e.from,p.to={appKey:t.appKey,name:e.to,domain:"easemob.com"},p.ns=1,p.type=1,p.payload=d;var f=t.context.root.lookup("easemob.pb.CommSyncUL"),l=f.decode(n);l.meta=p,l=f.encode(l).finish();var y=t.context.root.lookup("easemob.pb.MSync"),g=y.decode(n);g.version=t.version,g.encryptType=t.encryptType,g.command=0,g.guid=t.context.jid,g.payload=l,g=y.encode(g).finish(),t.sendMSync(g)},_sendMessage:function(e,t){var n,o=[],s=t.context.root.lookup("easemob.pb.ConferenceBody"),d=s.decode(o);e.content.video;0==e.content.op?n={op:e.content.op,callVersion:"2.0.0",audio:e.content.audio,video:e.content.video,tsxId:String(e.content.tsxId),peer:e.content.peer+"/",push:0}:400==e.content.op?n=e.content:(n=e.content).tsxId=String(e.content.tsxId);var a=e.content.op;if(d.content=JSON.stringify(n),d.routeFlag=e.rtflag,d.operation=7,d.sessionId=String(e.sid),d.type=e.type,102!=a&&104!=a&&105!=a&&107!=a&&400!=a||(d.routeKey=e.rtKey,d.routeFlag=e.rtflag,d.peerName=e.from.name),107==a){d.endReason={success:0,ok:0,timeout:1,decline:2,busy:3,"failed-transport":4,unsupported:5,offline:6}[e.reason]}console.log("%c"+JSON.stringify(d),"color: pink"),d=s.encode(d).finish();var i=t.context.root.lookup("easemob.pb.Meta").decode(o);i.id=String(e.id),i.ns=4,i.to={appKey:e.from.appKey,domain:e.from.domain,name:e.to},102==e.content.op&&(i.from=e.from),i.payload=d;var r=t.context.root.lookup("easemob.pb.CommSyncUL"),c=r.decode(o);c.meta=i,c=r.encode(c).finish();var p=t.context.root.lookup("easemob.pb.MSync"),f=p.decode(o);f.version=t.version,f.encryptType=t.encryptType,f.command=0,f.guid=t.context.jid,f.payload=c,f=p.encode(f).finish(),t.sendMSync(f)}},a=function(t){e.extend(!0,this,d,t||{}),this.init()};module.exports=a;
        },{"./utils":"yUjP","./api":"thlH"}],"GTpD":[function(require,module,exports) {
            "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e,t=require("easemob-emedia");t.Webrtc.prototype.AVPubstream=t.Service.prototype.AVPubstream,t.Webrtc.prototype._openCamera=function(){t.Service.prototype._openCamera.apply(this,arguments)},t.Webrtc.prototype.__getUserMedia=function(){t.Service.prototype.__getUserMedia.apply(this,arguments)},t.Webrtc.prototype.__controlStream=function(){t.Service.prototype.__controlStream.apply(this,arguments)},t.Webrtc.prototype.__sysGetUserMedia=function(){t.Service.prototype.__sysGetUserMedia.apply(this,arguments)},t.Webrtc.prototype.createMedia=function(e,o){var r=this,i=new r.AVPubstream({constaints:e,aoff:0,voff:0});t.Service.prototype.openUserMedia.bind(this)(i).then(function(e,t){WebIM.__alreadyOpenMedias.push(t),o&&o(r,t)},function(e){t.util.logger.debug("[WebRTC-API] getUserMedia() error: ",e),r.onError(e)})},t.Webrtc.prototype.createMedia=e=function(o,r){var i=this,a=new MediaStream;function s(){0==--s.count&&(WebIM.__alreadyOpenMedias.push(a),r&&r(i,a))}function n(e){e&&e.getTracks().forEach(function(e){a.addTrack(e)})}var c=!o||o.audio,p=!o||o.video;if(!c&&!p)return s.count=0,s();if(c&&p)return s.count=2,e.call(this,{video:o.video,audio:!1},function(e,t){n(t),s()}),void e.call(this,{video:!1,audio:o.audio},function(e,t){n(t),s()});s.count=1;var u=new i.AVPubstream({constaints:o});t.Service.prototype.openUserMedia.bind(this)(u).then(function(e,t){n(t),s()},function(e){s(),t.util.logger.debug("[WebRTC-API] getUserMedia() error: ",e),"function"==typeof e.message?e.message=e.message():"string"==typeof e.message&&""!==e.message?e.message=e.message:e.message="open media error. "+e.name,e.message=e.message+" when get "+(p?"carma":"microphone"),i.onError(e)})},t.Webrtc.prototype.setLocalVideoSrcObject=function(e){this._localStream=e,this.onGotLocalStream(e,this.streamType),this.setLocalStream(e),t.util.logger.debug("[WebRTC-API] you can see yourself !")};var o=t.Webrtc.prototype.setRemoteDescription;t.Webrtc.prototype.setRemoteDescription=function(e){var t,r,i,a,s;if("VOICE"===this.streamType){t=/a=sendrecv|a=sendonly/g,r="a=inactive",i=e.sdp.indexOf("m=video"),a=e.sdp.indexOf("m=audio"),s=a>i?a:e.sdp.length,e.sdp=e.sdp.replace(t,function(e,t,o){return t>=i&&t<s?r:e})}return o.call(this,e)};var r=t.Webrtc;exports.default=r;
        },{"easemob-emedia":"WNWS"}],"3mO+":[function(require,module,exports) {
            var e=require("./utils").default,n=require("./api").RouteTo,t=e.logger,i=n({success:function(e){t.debug("iq to server success",e)},fail:function(e){t.debug("iq to server error",e)}}),s={_pingIntervalId:null,_p2pConfig:null,_rtcCfg:null,_rtcCfg2:null,_rtKey:null,_rtFlag:null,webRtc:null,api:null,callee:null,isCaller:!1,accepted:!1,setLocalSDP:!1,setRemoteSDP:!1,hangup:!1,init:function(){var e=this;e.api.onPing=function(){e._onPing.apply(e,arguments)},e.api.onTcklC=function(){e._onTcklC.apply(e,arguments)},e.api.onAcptC=function(){e._onAcptC.apply(e,arguments)},e.api.onAnsC=function(){e._onAnsC.apply(e,arguments)},e.api.onTermC=function(){e._onTermC.apply(e,arguments)},e.api.onEvJoin=function(){e._onEvJoin.apply(e,arguments)},e.api.onStreamControl=function(){e._onStreamControl.apply(e,arguments)},e.webRtc.onIceCandidate=function(){e._onIceCandidate.apply(e,arguments)},e.webRtc.onIceStateChange=function(){e._onIceStateChange.apply(e,arguments)}},_ping:function(){var e=this;e._pingIntervalId=window.setInterval(function(){var n=new i({to:e.callee,rtKey:e._rtKey});e.api.ping(n,e._sessId,function(e,n){t.debug("ping result",n)})},5e4)},_onPing:function(e,n,i,s,o){t.debug("_onPing from",o)},initC:function(e,n){this.sid=n,this.isCaller=!0,this.accepted=!1,this.setLocalSDP=!1,this.setRemoteSDP=!1,this.hangup=!1,this.streamType=e.audio&&e.video?"VIDEO":"VOICE",this.createLocalMedia(e)},createLocalMedia:function(e){var n=this;this.webRtc.createMedia(e,function(e,t){n.webRtc.createRtcPeerConnection(n._rtcCfg),e.setLocalVideoSrcObject(t),e.localStream=t,n.webRtc.createOffer(function(e){n._onGotWebRtcOffer(e)})})},_onGotWebRtcOffer:function(e){var n=new i({to:this.callee,rtKey:this._rtKey});this.api.initC(n,this.streamType,null,null,this._sessId,this._rtcId,null,null,e,null,this._rtcCfg2,null,function(e,n){t.debug("initc result",n)}),this.setLocalSDP=!0,this._ping()},_onAcptC:function(e,n){n.ans&&1==n.ans?(t.info("[WebRTC-API] _onAcptC : 104, ans = 1, it is a answer. will onAcceptCall"),this.onAcceptCall(e,n,!1!==n.enableVoice,!1!==n.enableVideo),this._onAnsC(e,n)):WebIM.WebRTC.supportPRAnswer?(t.info("[WebRTC-API] _onAcptC : recv pranswer. "),(n.sdp||n.cands)&&(n.sdp&&this.webRtc.setRemoteDescription(n.sdp),this.setRemoteSDP=!0,this._handRecvCandsOrSend(e,n),this.onAcceptCall(e,n,!1!==n.enableVoice,!1!==n.enableVideo))):(t.info("[WebRTC-API] _onAcptC : not supported pranswer. drop it. will onAcceptCall"),this.setRemoteSDP=!1,this._handRecvCandsOrSend(e,n),this.onAcceptCall(e,n,!1!==n.enableVoice,!1!==n.enableVideo))},_onEvJoin:function(e,n,i,s,o){t.debug("_onEvJoin from",o,e),this.onAcceptCall(e,n,!1!==n.enableVoice,!1!==n.enableVideo)},onAcceptCall:function(e,n,t,i){},__onVoiceOrVideo:function(e,n,t){!1===n.enableVoice?this.onOtherUserOpenVoice(e,!1):this.onOtherUserOpenVoice(e,!0),!1===n.enableVideo?this.onOtherUserOpenVideo(e,!1):this.onOtherUserOpenVideo(e,!0)},_onStreamControl:function(e,n,t,i,s){var o=n.controlType;0===o&&this.onOtherUserOpenVoice(e,!1),1===o&&this.onOtherUserOpenVoice(e,!0),2===o&&this.onOtherUserOpenVideo(e,!1),3===o&&this.onOtherUserOpenVideo(e,!0),this.onStreamControl(e,n,t,i,s)},onStreamControl:function(e,n,t,i,s){},onOtherUserOpenVoice:function(e,n){t.debug("from open:",n," voice .",e)},onOtherUserOpenVideo:function(e,n){t.debug("from open:",n," voideo .",e)},_onAnsC:function(e,n){t.info("[WebRTC-API] _onAnsC : recv answer. "),this.accepted=!0,n.sdp&&this.webRtc.setRemoteDescription(n.sdp),this.setRemoteSDP=!0,this._handRecvCandsOrSend(e,n),this.__onVoiceOrVideo(e,n)},_onInitC:function(e,n,i,s,o){var a=this;a.isCaller=!1,a.accepted=!1,a.setLocalSDP=!1,a.setRemoteSDP=!1,a.hangup=!1,a.callee=e,a._rtcCfg2=n.rtcCfg,a._rtKey=i,a._tsxId=s,a._fromSid=o,a._rtcId=n.rtcId,a._sessId=n.sessId,a.streamType=n.streamType,a.webRtc.createRtcPeerConnection(a._rtcCfg2),a.callerNotPranswer=0===n.expr,t.warn("caller not pranswer ",a.callerNotPranswer),n.sdp&&t.debug(n.sdp.sdp),n.sdp&&a.webRtc.setRemoteDescription(n.sdp).then(function(){a.setRemoteSDP=!0,a._handRecvCandsOrSend(e,n),WebIM.WebRTC.supportPRAnswer?a.webRtc.createPRAnswer(function(e){a._onGotWebRtcPRAnswer(e),setTimeout(function(){t.info("[WebRTC-API] onRinging : after send pranswer. ",a.callee),a.onRinging(a.callee,a.streamType)},500)}):(setTimeout(function(){t.info("[WebRTC-API] onRinging : After iniC, cause by: not supported pranswer. ",a.callee),a.onRinging(a.callee,a.streamType)},500),a._ping())})},_onGotWebRtcPRAnswer:function(e){var n=new i({to:this.callee,rtKey:this._rtKey});this.api.acptC(n,this._sessId,this._rtcId,e),this.setLocalSDP=!0,this._handRecvCandsOrSend(),this._ping()},onRinging:function(e,n){},accept:function(){var e=this;var n={audio:!0};"VIDEO"==e.streamType&&(n.video=!0),e.webRtc.createMedia(n,function(n,s){n.setLocalVideoSrcObject(s),t.info("createAndSendAnswer : ...... "),e.webRtc.createAnswer(function(n){var s=new i({to:e.callee,rtKey:e._rtKey});WebIM.WebRTC.supportPRAnswer?e.webRtc.isConnected()||e.callerNotPranswer?(t.info("[WebRTC-API] ice connected or caller not pranswer, may send answer"),e.api.ansC(s,e._sessId,e._rtcId,n)):(t.info("[WebRTC-API] ice state not connected, send answer waiting."),e.webRtc._hookWhenICEReady=function(){t.info("[WebRTC-API] ice connected, send answer"),e.api.ansC(s,e._sessId,e._rtcId,n)}):e.api.acptC(s,e._sessId,e._rtcId,n,null,1),WebIM.WebRTC.supportPRAnswer||(e.setLocalSDP=!0),e._handRecvCandsOrSend(),e.accepted=!0})})},_handRecvCandsOrSend:function(e,n){var t=this;setTimeout(function(){t._onTcklC(e,n)},50),setTimeout(function(){t._onIceCandidate()},50)},_onTcklC:function(e,n){if(this.setRemoteSDP)t.info("[WebRTC-API] recv and add cands."),this._recvCands&&this._recvCands.length>0&&this.webRtc.addIceCandidate(this._recvCands),this._recvCands&&this._recvCands.length>0&&(this._recvCands=[]),n&&n.cands&&this.webRtc.addIceCandidate(n.cands);else if(n&&n.cands&&n.cands.length>0){for(var i=0;i<n.cands.length;i++)(this._recvCands||(this._recvCands=[])).push(n.cands[i]);t.debug("[_onTcklC] temporary memory[recv] ice candidate. util setRemoteSDP = true")}},_onIceStateChange:function(e){t.debug("[WebRTC-API] ice state is "+e),this.webRtc.isConnected()&&(this.webRtc._hookWhenICEReady&&this.webRtc._hookWhenICEReady(),this.webRtc._hookWhenICEReady=void 0),"closed"===e&&(this.setLocalSDP=!1,this.setRemoteSDP=!1),this.api.onIceConnectionStateChange(e)},_onIceCandidate:function(e){var n=this;if(n.setLocalSDP){var s=function(e){t.debug("send ice candidate...");var s=new i({to:n.callee,rtKey:n._rtKey});e&&n.api.tcklC(s,n._sessId,n._rtcId,null,e)};n._cands&&n._cands.length>0&&(s(n._cands),n._cands=[]),e&&s(e)}else e&&(n._cands||(n._cands=[])).push(e),t.debug("[_onIceCandidate] temporary memory[send] ice candidate. util setLocalSDP = true")},__termCall1:function(e){this._pingIntervalId&&window.clearInterval(this._pingIntervalId);var n,t=new i({to:this.callee,rtKey:this._rtKey});e||!this.isCaller&&!this.accepted&&(n="decline")||(n="success"),this.hangup||this.api.termC(t,this._sessId,this._rtcId,n),this.webRtc.close(),this.hangup=!0,this.setLocalSDP=!1,this.setRemoteSDP=!1,this.onTermCall(e)},termCall:function(e){try{this.__termCall1(e)}finally{if(WebIM.__alreadyOpenMedias&&WebIM.__alreadyOpenMedias.length>0){for(var n in WebIM.__alreadyOpenMedias){var t=WebIM.__alreadyOpenMedias[n];try{emedia.stopTracks(t)}catch(i){}}WebIM.__alreadyOpenMedias=[]}}},_onTermC:function(e,n){t.debug("[_onTermC] options.reason = "+n.reason);this.hangup=!0,this.setLocalSDP=!1,this.setRemoteSDP=!1,this.termCall(n.reason)},onTermCall:function(){}};module.exports=function(n){e.extend(!0,this,s,n||{}),this.init()};
        },{"./utils":"yUjP","./api":"thlH"}],"J9kn":[function(require,module,exports) {
            var t=require("./utils").default,e=require("./iq"),n=require("./api"),i=require("./webrtc").default,o=require("./p2p"),r=n.RouteTo,a=n.Api,s=t.logger,c={api:null,caller:"",connection:null,pattern:null,listener:{onAcceptCall:function(t,e){},onRinging:function(t){},onTermCall:function(){},onIceConnectionStateChange:function(t){}},mediaStreamConstaints:{audio:!0,video:!0},init:function(){var t=this;if(void 0===t.connection)throw"Caller need a instance of Easemob.im.Connection";t.api=t.api||new a({imConnection:t.connection,rtcHandler:new e({imConnection:t.connection})}),t.api.onInitC=function(){t._onInitC.apply(t,arguments)},t.api.onInvite=function(){t.listener.onInvite.apply(t,arguments)},t.api.onIceConnectionStateChange=function(){t.listener.onIceConnectionStateChange.apply(t,arguments)}},createConference:function(t,e){var n=new r({rtKey:""});this.api.reqTkt(n,!0,void 0,t,function(t,n){n.ticket;n.conferenceId=n.confrId,e&&e(t,n)})},inviteConference:function(t,e,n,i,o){var a=new r({to:n,rtKey:"",rtflag:0});this.api.invite(a,t,e,i,function(t,e){o&&o(t,e)})},getConferenceTkt:function(t,e,n){var i=new r({rtKey:""});this.api.reqTkt(i,!1,t,e,function(t,e){n&&n(t,e)})},makeVideoCall:function(e,n){t.extend({},this.mediaStreamConstaints),this.mediaStreamConstaints.video=!0,this.call(e,this.mediaStreamConstaints,n)},makeVoiceCall:function(e,n){console.log("ScareCrow");t.extend({},this.mediaStreamConstaints),this.mediaStreamConstaints.video=!1,this.call(e,this.mediaStreamConstaints,n)},acceptCall:function(){this.pattern.accept()},endCall:function(t){this.caller="",this.pattern.termCall()},call:function(t,e,n){var i=this;this.callee=this.api.jid(t);var o=new r({rtKey:"",sid:n,to:t,success:function(t){s.debug("iq to server success",t)},fail:function(t){s.debug("iq to server error",t),i.onError(t)}});this.api.reqP2P(o,e.video?1:0,e.audio?1:0,this.api.jid(t),function(t,e){"0"!=e.online?(i._onGotServerP2PConfig(t,e),i.pattern.initC(i.mediaStreamConstaints,n)):i.listener.onError({message:"callee is not online!"})})},controlStream:function(t,e){var n=new r({to:e,rtKey:"",rtflag:0});this.api.streamControl(n,null,this.rtcId,t,this.localStream)},_onInitC:function(t,e,n,i,o){this.callee=t,this._rtcCfg=e.rtcCfg,this._WebRTCCfg=e.WebRTC,this.sessId=e.sessId,this.rtcId=e.rtcId,this.switchPattern("VIDEO"==e.streamType?"VIDEO":"VOICE"),this.pattern._onInitC(t,e,n,i,o)},_onInvite:function(){},_onGotServerP2PConfig:function(t,e){0==e.result&&(this._p2pConfig=e,this._rtcCfg=e.rtcCfg,this._rtcCfg2=e.rtcCfg2,this.sessId=e.sessId,this.rtcId="RTCID"+e.sessId,this._rtKey=this._rtkey=e.rtKey||e.rtkey,this._rtFlag=this._rtflag=e.rtFlag||e.rtflag,this._WebRTCCfg=e.WebRTC,this.admtok=e.admtok,this.tkt=e.tkt,this.switchPattern(this.mediaStreamConstaints.audio&&this.mediaStreamConstaints.video?"VIDEO":"VOICE"))},switchPattern:function(t){var e=this;!e._WebRTCCfg&&(e.pattern=new o({callee:e.callee,_p2pConfig:e._p2pConfig,_rtcCfg:e._rtcCfg,_rtcCfg2:e._rtcCfg2,_rtKey:e._rtKey||e._rtkey,_rtFlag:e._rtFlag||e._rtflag,_sessId:e.sessId,_rtcId:e.rtcId,webRtc:new i({streamType:t,subArgs:{subSVideo:"VIDEO"===t,subSAudio:!0},onGotLocalStream:function(n,i){e.listener.onGotLocalStream(n,t),e.localStream=n,console.log("self.localStreamself.localStream",e.localStream)},onGotRemoteStream:function(n,i){e.listener.onGotRemoteStream(n,t),e.remoteStream=n,console.log("self.remoteStream.remoteStream",e.remoteStream)},onError:e.listener.onError}),api:e.api,onAcceptCall:e.listener&&e.listener.onAcceptCall||function(){},onRinging:e.listener&&e.listener.onRinging||function(){},onTermCall:e.listener&&e.listener.onTermCall||function(){},onOtherUserOpenVoice:e.listener&&e.listener.onOtherUserOpenVoice||function(){},onOtherUserOpenVideo:e.listener&&e.listener.onOtherUserOpenVideo||function(){}}))}};module.exports=function(e){t.extend(!0,this,c,e||{}),this.init()};
        },{"./utils":"yUjP","./iq":"7BK3","./api":"thlH","./webrtc":"GTpD","./p2p":"3mO+"}],"JWwv":[function(require,module,exports) {
            var define;
            var e;function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var n=require("./components/utils").default,t=require("./components/call"),r=require("easemob-emedia");console.log("emedia",r),window.WebIM="undefined"!=typeof WebIM?WebIM:{},WebIM.WebRTC=WebIM.WebRTC||{},WebIM.WebRTC.Call=t,WebIM.WebRTC.Util=n,WebIM.__alreadyOpenMedias=[],"object"===("undefined"==typeof module?"undefined":o(module))&&"object"===o(module.exports)?module.exports=WebIM.WebRTC:"function"==typeof e&&e.amd&&e([],function(){return WebIM.WebRTC}),WebIM.WebRTC.supportPRAnswer=r.supportPRAnswer,console&&console.warn("Webrtc version","Git.e4f0006");
        },{"./components/utils":"yUjP","./components/call":"J9kn","easemob-emedia":"WNWS"}],"Focm":[function(require,module,exports) {
            module.exports=require("./src/entry");
        },{"./src/entry":"JWwv"}]},{},["Focm"], "webrtc")
    //# sourceMappingURL=/EMedia_x1v1.js.map</script>

</head>

<body>
    <div>
        用户名：<input type="text" name="name" id="name"> </br>
        密 码：<input type="text" name="pwd" id="pwd"></br>

        用户ID: <input type="text" name="toname" id="toname"></br>
        消息：<input type="text" name="msg" id="msg">
    </div>
    <div>
        <h3>Registered login</h3>
        <button id="register">Register</button>
        <button id="login">Login</button>
        <button id="logout">Logout</button>
    </div>
    <h3>Message</h3>
    <div>
        <button id="privateText">PrivateText</button>
        <button id="privateCmd">PrivateCmd</button>
        <button id="privateLoc">PrivateLoc</button>
        <button id="recMessage">RecMessage</button>
    </div>
    <div>
        <br> image:
        <input type="file" id="image">
        <button id="privateImg">PrivateImg</button>
    </div>
    <div>
        <br> audio:
        <input type="file" id="audio">
        <button id="privateAudio">PrivateAudio</button>
    </div>
    <div>
        <br> video:
        <input type="file" id="chatVideo">
        <button id="privateVideo">PrivateVideo</button>
        <br>
        <video id="getVideo" style="border: 1px solid red" autoplay>
        </video>
    </div>
    <br>
    <h3>Roasters</h3>
    <div>
        <button id="getRoasters">GetRoasters</button>
        <button id="addFriends">AddFriends</button>
        <button id="agreeFriends">AgreeFriends</button>
        <button id="rejectFriends">RejectFriends</button>
        <button id="removeRoster">RemoveRoster</button>
        <button id="addToBlackList">AddToBlackList</button>
        <button id="getBlackList">GetBlackList</button>
        <button id="removeFromBlackList">RemoveFromBlackList</button>
    </div>
    <h3>Group</h3>
    <div>
        <button id="createGroup">CreateGroupNew</button>
        <button id="sendCmdExt">SendCmdExt</button>
        <button id="joinGroup">JoinGroup</button>
        <button id="getGroup">GetGroup</button>
        <button id="getGroupMember">GetGroupMember</button>
        <button id="groupText">GroupText</button>
        <button id="getGroupInfo">GetGroupInfo</button>
        <button id="changeGroupInfo">ChangeGroupInfo</button>
        <button id="addGroupMembers">AddGroupMembers</button>
        <button id="addMuteUser">AddMuteUser</button>
        <button id="removeMuteUser">RemoveMuteUser</button>
        <button id="getMuteList">GetMuteList</button>
        <button id="setAdminUser">SetAdminUser</button>
        <button id="removeAdminUser">RemoveAdminUser</button>
        <button id="getGroupAdmin">GetGroupAdmin</button>
        <button id="groupBlockSingle">GroupBlockSingle</button>
        <button id="removeGroupBlockSingle">RemoveGroupBlockSingle</button>
        <button id="leaveGroup">LeaveGroup</button>
        <button id="dissolveGroup">DissolveGroup</button>
        <div>
            <br> image:
            <input type="file" id="gimg">
            <button id="groupImg">sendGroupImg</button>
        </div>
    </div>
    <h3>Rooms</h3>
    <div>
        <button id="getRoomsList">GetRommsList</button>
        <button id="joinRoom">JoinRoom</button>
        <button id="roomText">RoomText</button>
        <button id="quitRoom">QuitRoom</button>
        <div>
            <br> image:
            <input type="file" id="rimg">
            <button id="roomImg">sendRoomImg</button>
        </div>
    </div>
    <h3>WebRTC</h3>
    <div>
        <button id="rtCall">Call</button>
        <button id="rtAcceptCall">AcceptCall</button>
        <button id="rtEndCall">EndCall</button>
        <button id="rtAudioCall">AudioCall</button>
        <div>
            <video id="video" style="border: 1px solid red" autoplay>

            </video>
            <video id="localVideo" style="border: 1px solid blue" muted=true autoplay>

            </video>
        </div>
    </div>
    <h3>Confer</h3>
    <div>
        <button id="createConfer">CreateConfer</button>
        <button id="pushVideo">PushVideo</button>
        <button id="inviteUser">InviteUser</button>
        <button id="txtInviteUser">TxtInviteUser</button>
        <button id="endConVideo">EndConVideo</button>
        </video>
    </div>

    <script>
        var conn = {};
        console.log(WebIM, window.WebIM);
        WebIM.config = config;
        conn = WebIM.conn = new WebIM.default.connection({
            appKey: WebIM.config.appkey,
            isHttpDNS: WebIM.config.isHttpDNS,
            isMultiLoginSessions: WebIM.config.isMultiLoginSessions,
            host: WebIM.config.Host,
            https: WebIM.config.https,
            url: WebIM.config.xmppURL,
            apiUrl: WebIM.config.apiURL,
            isAutoLogin: false,
            heartBeatWait: WebIM.config.heartBeatWait,
            autoReconnectNumMax: WebIM.config.autoReconnectNumMax,
            autoReconnectInterval: WebIM.config.autoReconnectInterval,
            isStropheLog: WebIM.config.isStropheLog,
            delivery: WebIM.config.delivery
        })


        conn.listen({
            onOpened: function (message) {          //连接成功回调
                var myDate = new Date().toLocaleString();
                console.log("%c [opened] 连接已成功建立", "color: green");
                console.log(myDate);
                // rek();
                // alert(myDate + "登陆成功")
            },
            onClosed: function (message) {
                console.log("onclose:" + message);
                console.log(error);
            },         //连接关闭回调
            onTextMessage: function (message) {
                console.log('onTextMessage: ', message);
                if (message.ext.conferenceId != undefined) {
                    var truthBeTold = window.confirm((message.from + "邀请您加入会议"));
                    if (truthBeTold) {
                        emedia.mgr.joinConference(message.ext.conferenceId, message.ext.password, "进入会议").then(function () {
                            console.log("********加入会议成功*******")
                        }).catch(function (error) {
                            console.log("加入会议失败")
                        })
                    }
                }

            },    //收到文本消息

            onEmojiMessage: function (message) {
                console.log('onEmojiMessage: ', message);
            },   //收到表情消息
            onPictureMessage: function (message) {
                console.log('onPicMessage: ', message);
            }, //收到图片消息
            onCmdMessage: function (message) {
                console.log('onCmdMessage: ', message);
            },     //收到命令消息
            onAudioMessage: function (message) {
                console.log('onAudioMessage: ', message);
            },   //收到音频消息
            onLocationMessage: function (message) {
                console.log('onLocMessage: ', message);
            },//收到位置消息
            onFileMessage: function (message) {
                console.log('onFileMessage: ', message);
            },    //收到文件消息
            recallMessage: function (message) {
                console.log('recallMessage', message);
            }, //消息撤回
            onVideoMessage: function (message) {
                console.log('onVideoMessage: ', message);
                var node = document.getElementById('getVideo');
                var option = {
                    url: message.url,
                    headers: {
                        'Accept': 'audio/mp4'
                    },
                    onFileDownloadComplete: function (response) {
                        var objectURL = WebIM.utils.parseDownloadResponse.call(conn, response);
                        node.src = objectURL;
                    },
                    onFileDownloadError: function () {
                        console.log('File down load error.')
                    }
                };
                WebIM.utils.download.call(conn, option);
            },   //收到视频消息
            onPresence: function (message) {
                var myDate = new Date().toLocaleString();
                console.log('onPresence: ', myDate + JSON.stringify(message));
                switch (message.type) {
                    case 'subscribe': // 对方请求添加好友
                        var truthBeTold = window.confirm((message.from + "申请添加您为好友:"));
                        if (truthBeTold) {
                            // 同意对方添加好友
                            conn.subscribed({
                                to: message.from,
                                message: "[resp:true]"
                            });
                            console.log("同意添加好友");
                        } else {
                            // 拒绝对方添加好友
                            conn.unsubscribed({
                                to: message.from,
                                message: "rejectAddFriend" // 拒绝添加好友回复信息
                            });
                            console.log("拒绝添加好友");
                        }
                        break;
                    case 'subscribed': // 对方同意添加好友，已方同意添加好友
                        break;
                    case 'unsubscribe': // 对方删除好友
                        break;
                    case 'unsubscribed': // 被拒绝添加好友，或被对方删除好友成功
                        break;
                    case 'memberJoinPublicGroupSuccess': // 成功加入聊天室
                        console.log('join chat room success' + myDate);
                        console.log(new Date().toLocaleString());
                        break;
                    case 'joinChatRoomFaild': // 加入聊天室失败
                        console.log('join chat room faild');
                        break;
                    case 'joinPublicGroupSuccess': // 意义待查
                        console.log('join public group success', message.from);
                        break;
                    case 'createGroupACK':
                        conn.createGroupAsync({
                            from: message.from,
                            success: function (option) {
                                console.log('Create Group Succeed');
                            }
                        });
                        break;
                }
            },       //处理“广播”或“发布-订阅”消息，如联系人订阅请求、处理群组、聊天室被踢解散等消息
            onRoster: function (message) {
                console.log("onRoster", message);
            },         //处理好友申请
            onInviteMessage: function (message) {
                console.log('Invite');
            },  //处理群组邀请
            onOnline: function () {
                console.log("onOnline");
            },                  //本机网络连接成功
            onOffline: function () {
                console.log('offline');
            },                 //本机网络掉线
            onError: function (message) {
                console.log('onError: ', message);

            },          //失败回调
            onBlacklistUpdate: function (list) {       //黑名单变动
                // 查询黑名单，将好友拉黑，将好友从黑名单移除都会回调这个函数，list则是黑名单现有的所有好友信息
                console.log(list);
            },
            onReceivedMessage: function (message) {
                console.log('onReceivedMessage: ', message);
            },    //收到消息送达服务器回执
            onDeliveredMessage: function (message) {
                console.log('onDeliveredMessage：', message);
            },   //收到消息送达客户端回执
            onReadMessage: function (message) {
                console.log('onReadMessage: ', message);
            },        //收到消息已读回执
            onCreateGroup: function (message) {
                console.log('onCreateGroup: ', message);
            },        //创建群组成功回执（需调用createGroupNew）
            onMutedMessage: function (message) {
                console.log('onMutedMessage: ', message);
            }         //如果用户在A群组被禁言，在A群发消息会走这个回调并且消息不会传递给群其它成员
        });

        //初始化单人视频
        // 初始化WebRTC Call
        window.rtcCall = null
        if (WebIM.WebRTC) {
            rtcCall = new WebIM.WebRTC.Call({
                connection: conn,

                mediaStreamConstaints: {
                    audio: true,
                    video: true
                },

                listener: {
                    onAcceptCall: function (from, options) {
                        console.log('onAcceptCall::', 'from: ', from, 'options: ', options);
                    },
                    onGotRemoteStream: function (stream, streamType) {
                        console.log('onGotRemoteStream::', 'stream: ', stream, 'streamType: ', streamType);
                        var video = document.getElementById('video');
                        video.srcObject = stream;
                    },
                    onGotLocalStream: function (stream, streamType) {
                        console.log('onGotLocalStream::', 'stream:', stream, 'streamType: ', streamType);
                        var video = document.getElementById('localVideo');
                        video.srcObject = stream;
                    },
                    onRinging: function (caller) {
                        console.log('onRinging::', 'caller:', caller);
                        alert('onRinging::', 'caller:', caller)
                    },
                    onTermCall: function (reason) {
                        console.log('onTermCall::');
                        console.log('reason:', reason);
                    },
                    onIceConnectionStateChange: function (iceState) {
                        console.log('onIceConnectionStateChange::', 'iceState:', iceState);
                    },
                    onError: function (e) {
                        console.log(e);
                    }
                }
            });
        } else {
            console.warn('不能进行视频通话！您的浏览器不支持webrtc或者协议不是https。')
        }


        //有人加入会议，其他人调用joinXX等方法，如果加入成功，已经在会议中的人将会收到
        emedia.mgr.onMemberJoined = function (member) {
            console.log(member.name, "加入会议");
        };
        //有人退出会议
        emedia.mgr.onMemberExited = function (member) {
            console.log(member.name, "退出会议");
        };
        //有媒体流添加；比如 自己调用了publish方法（stream.located() === true时），或其他人调用了publish方法。
        emedia.mgr.onStreamAdded = function (member, stream) {
            console.log("媒体流加入");
            var located = stream.located();
            if (located) {

            } else {
                emedia.mgr.subscribe(member, stream, true, true, localVideo);
            }
        }
        //有媒体流移除
        emedia.mgr.onStreamRemoved = function (member, stream) {
            console.log("媒体流退出");
        };
        //角色改变
        emedia.mgr.onRoleChanged = function (role) {
            console.log("角色改变成功");
            //会议退出；自己主动退 或 服务端主动关闭；
            emedia.mgr.onConferenceExit = function (reason, failed) {
                reason = (reason || 0);
                switch (reason) {
                    case 0:
                        reason = "正常挂断";
                        break;
                    case 1:
                        reason = "没响应";
                        break;
                    case 2:
                        reason = "服务器拒绝";
                        break;
                    case 3:
                        reason = "对方忙";
                        break;
                    case 4:
                        reason = "失败,可能是网络或服务器拒绝";
                        if (failed === -9527) {
                            reason = "失败,网络原因";
                        }
                        if (failed === -500) {
                            reason = "Ticket失效";
                        }
                        if (failed === -502) {
                            reason = "Ticket过期";
                        }
                        if (failed === -504) {
                            reason = "链接已失效";
                        }
                        if (failed === -508) {
                            reason = "会议无效";
                        }
                        if (failed === -510) {
                            reason = "服务端限制";
                        }
                        break;
                    case 5:
                        reason = "不支持";
                        break;
                    case 10:
                        reason = "其他设备登录";
                        break;
                    case 11:
                        reason = "会议关闭";
                        break;
                }
            };
        };

    </script>
    <script>
        //注册
        // document.getElementById('register').onclick = function () {
        //     var uname = document.getElementById("name").value;
        //     var upwd = document.getElementById("pwd").value;
        //     var option = {
        //         username: uname,
        //         password: upwd,
        //         appKey: WebIM.config.appkey,
        //         success: function () {
        //             console.log('注册成功');
        //         },
        //         error: function () {
        //             console.log('注册失败');
        //         },
        //         apiUrl: WebIM.config.apiURL
        //     };
        //     conn.signup(option);
        // };

        //登录
        document.getElementById('login').onclick = function () {
            console.log(WebIM, window.WebIM);
            var uname = document.getElementById("name").value;
            var upwd = document.getElementById("pwd").value;
            options = {
                apiUrl: WebIM.config.apiURL,
                user: uname,
                pwd: upwd,
                appKey: WebIM.config.appkey
            };
            conn.open(options);
            console.log(options)
        };

        //退出
        document.getElementById("logout").onclick = function () {
            conn.close();
        }
    </script>
    <script>
        /*
        * Message
        */
        //文本消息
        var conf = WebIM.config
        //var WebIM = WebIM.default
        WebIM.config = conf
        WebIM.message = WebIM.default.message
        WebIM.utils = WebIM.default.utils
        WebIM.debug = WebIM.default.debug
        WebIM.statusCode = WebIM.default.statusCode

        var myDate = new Date().toLocaleString();
        document.getElementById('privateText').onclick = function () {
            var uname = document.getElementById("name").value;
            var tname = document.getElementById("toname").value;
            var tmsg = document.getElementById("msg").value;
            var id = conn.getUniqueId();                 // 生成本地消息id
            var msg = new WebIM.default.message('txt', id);      // 创建文本消息
            msg.set({
                msg: tmsg,                  // 消息内容
                to: tname,
                ext: {
                    'time': myDate
                },                       // 接收消息对象（用户id）
                success: function (id, serverMsgId) {
                    console.log('send private text Success');
                    msgText = msg.body.msg;
                },
                fail: function (e) {
                    console.log("Send private text error");
                }
            });
            msg.body.chatType = 'singleChat';
            conn.send(msg.body);
            console.log(msg);

        };

        //位置消息
        document.getElementById("privateLoc").onclick = function () {
            var tname = document.getElementById("toname").value;
            var tmsg = document.getElementById("msg").value;
            var id = conn.getUniqueId();                 // 生成本地消息id
            var msg = new WebIM.default.message('location', id);      // 创建位置消息
            msg.set({
                to: tname,                          // 接收消息对象（用户id）
                roomType: false,
                addr: "北京四通桥",
                lat: "39.9666",
                lng: "116.322"
            })
            msg.body.chatType = 'singleChat';
            conn.send(msg.body);
        };
        //透传消息
        document.getElementById('privateCmd').onclick = function () {
            var tname = document.getElementById("toname").value;
            var tmsg = document.getElementById("msg").value;
            var id = conn.getUniqueId();            //生成本地消息id
            var msg = new WebIM.default.message('cmd', id); //创建命令消息
            msg.set({
                msg: tmsg,
                to: tname,                       //接收消息对象
                action: 'action',                     //用户自定义，cmd消息必填
                ext: {
                    'time': myDate,
                },
                success: function (id, serverMsgId) {
                    console.log('send private cmd Success');
                },
                fail: function (e) {
                    console.log("Send private cmd error");
                }
            })

            msg.body.chatType = 'singleChat';
            conn.send(msg.body);
        };

        //图片消息
        document.getElementById('privateImg').onclick = function () {
            var tname = document.getElementById("toname").value;
            var id = conn.getUniqueId();                   // 生成本地消息id
            var msg = new WebIM.default.message('img', id);        // 创建图片消息
            var input = document.getElementById('image');  // 选择图片的input
            var file = WebIM.default.utils.getFileUrl(input);      // 将图片转化为二进制文件
            var allowType = {
                'jpg': true,
                'gif': true,
                'png': true,
                'bmp': true
            };
            if (file.filetype.toLowerCase() in allowType) {
                var option = {
                    apiUrl: WebIM.config.apiURL,
                    file: file,
                    to: tname,
                    ext: {
                        'time': myDate,
                    },           // 接收消息对象
                    roomType: false,
                    chatType: 'singleChat',
                    onFileUploadError: function () {      // 消息上传失败
                        console.log('onFileUploadError');
                    },
                    onFileUploadComplete: function () {   // 消息上传成功
                        console.log('onFileUploadComplete');
                    },
                    success: function () {                // 消息发送成功
                        console.log('Success');
                    },
                    flashUpload: WebIM.flashUpload
                };
                msg.set(option);
                conn.send(msg.body);
            }
        };

        //音频消息
        document.getElementById("privateAudio").onclick = function () {
            var tname = document.getElementById("toname").value;
            var id = conn.getUniqueId();                   // 生成本地消息id
            var msg = new WebIM.default.message('audio', id);      // 创建音频消息
            var input = document.getElementById('audio');  // 选择音频的input
            var file = WebIM.default.utils.getFileUrl(input);      // 将音频转化为二进制文件
            var allowType = {
                'mp3': true,
                'amr': true,
                'wmv': true,
                'm4a': true
            };
            if (file.filetype.toLowerCase() in allowType) {
                var option = {
                    apiUrl: WebIM.config.apiURL,
                    file: file,
                    to: tname,
                    ext: {
                        'time': myDate,
                    },
                    roomType: false,
                    chatType: 'singleChat',
                    onFileUploadError: function () {      // 消息上传失败
                        console.log('onFileUploadError');
                    },
                    onFileUploadComplete: function () {   // 消息上传成功
                        console.log('onFileUploadComplete');

                    },
                    success: function () {                // 消息发送成功
                        console.log('Success');
                    },
                    flashUpload: WebIM.flashUpload
                };
                msg.set(option);
                conn.send(msg.body);
            }
        };

        //视频消息
        document.getElementById("privateVideo").onclick = function () {
            var tname = document.getElementById("toname").value;
            var id = conn.getUniqueId();                   // 生成本地消息id
            var msg = new WebIM.message('video', id);      // 创建视频消息
            var input = document.getElementById('chatVideo');  // 选择视频的input
            var file = WebIM.utils.getFileUrl(input);      // 将视频转化为二进制文件
            var allowType = {
                'mp4': true,
                'wmv': true,
                'avi': true,
                'rmvb': true,
                'mkv': true
            };
            if (file.filetype.toLowerCase() in allowType) {
                var option = {
                    apiUrl: WebIM.config.apiURL,
                    file: file,
                    to: tname,                       // 接收消息对象
                    roomType: false,
                    onFileUploadError: function () {      // 消息上传失败
                        console.log('onFileUploadError');
                    },
                    onFileUploadComplete: function () {   // 消息上传成功
                        console.log('onFileUploadComplete');
                    },
                    success: function () {                // 消息发送成功
                        console.log('Success');
                    },
                    flashUpload: WebIM.flashUpload
                };
                msg.set(option);
                conn.send(msg.body);
            }
        };
        //消息撤回
        document.getElementById("recMessage").onclick = function () {
            var tname = document.getElementById("toname").value;
            conn.recallMessage({
                mid: "578586538653255316",
                to: tname,
                success: function (id) {
                    console.log(id) // id为撤回通知的id
                },
                fail: function (err) {
                    console.log(err)
                }
            })
        }


    </script>
    <script>
        /*
        * Roasters
        */
        //好友列表
        document.getElementById("getRoasters").onclick = function () {
            conn.getRoster({
                success: function (roster) {
                    console.log(roster);
                    //获取好友列表，并进行好友列表渲染，roster格式为：
                    /*
                 [
                 {
                 jid:"easemob#chatdemoui_test1@easemob.com",
                 name:"test1",
                 subscription: "both"
                 // subscription的值的集合是{both, to, from, none},
                 // both表示互相在对方的好友列表中，
                 // to 和 from意义待定
                 // 如果添加对方为好友被拒绝则为none
                 }
                 ]
                 */
                    for (var i = 0, l = roster.length; i < l; i++) {
                        var ros = roster[i];
                        //ros.subscription值为both/to为要显示的联系人，此处与APP需保持一致，才能保证两个客户端登录后的好友列表一致
                        if (ros.subscription === 'both' || ros.subscription === 'to') {

                        }
                    }
                },
            });
        };

        //添加好友
        document.getElementById("addFriends").onclick = function () {
            var tname = document.getElementById("toname").value;
            conn.subscribe({
                to: tname,
                // Demo里面接收方没有展现出来这个message，在status字段里面
                message: '加个好友呗!'
            });
            console.log("发送申请成功");
        };

        //删除好友
        document.getElementById("removeRoster").onclick = function () {
            conn.removeRoster({
                to: tname,
                success: function () {  // 删除成功
                    conn.unsubscribed({
                        to: tname
                    });
                    console.log("删除成功");
                },
                error: function () {    // 删除失败
                }
            });
        };

        //添加黑名单
        // list的结构为{username_1: {}, username_2: {}...}，拉黑好友需要将拉黑后的黑名单里的好友信息全部传入，
        // 如黑名单此时已有A，B两位好友，现想将C也拉进黑名单，正确的操作是同时将ABC的信息都传入接口中。
        /*
         var list = {
         username_1:{
         jid: 'appKey_'+username_1+'@easemob.com',
         name: username_1,
         subscription: 'both',
         order: 2
         },
         username_2:{
         jid: 'appKey_'+username_2+'@easemob.com',
         name: username_2,
         subscription: 'both',
         order: 3,
         type: 'jid'
         },
         username_3:{
         jid: 'appKey_'+username_3+'@easemob.com',
         name: username_3,
         subscription: 'both',
         order: 4,
         type: 'jid'
         }
         }
         jid, username, subscription均在获取好友列表时已获取到，用户可根据好友列表动态获取这些参数，
         order不重复即可
         */
        document.getElementById("addToBlackList").onclick = function () {
            var list = {
                // user_1
                asdfghj: {
                    jid: 'easemob-demo#chatdemoui_asdfghj@easemob.com',
                    name: 'asdfghj',
                    subscription: 'both',
                    order: 2,
                    type: 'jid'
                },
                // user_2
                wjy6: {
                    jid: 'easemob-demo#chatdemoui_wjy6@easemob.com',
                    name: 'wjy6',
                    subscription: 'both',
                    order: 3,
                    type: 'jid'
                }
            };
            conn.addToBlackList({
                list: list,
                type: 'jid',
                success: function () {
                    console.log('Add friend to black list success');
                },
                error: function () {
                    console.log('Add friend to black list error');
                }
            });
        };

        //获取好友黑名单
        //调用getBlacklist函数获取好友黑名单列表。调用这个函数时，会回调conn.listen里的onBlacklistUpdate函数，具体细节请参照Web SDK基础功能。
        document.getElementById("getBlackList").onclick = function () {
            conn.getBlacklist();
        };

        //移除好友黑名单
        document.getElementById("removeFromBlackList").onclick = function () {
            var list = [
                {
                    wjy6: {
                        jid: 'easemob-demo#chatdemoui_mengyuanyuan01@easemob.com',
                        name: 'mengyuanyuan01',
                        order: '2',
                        type: 'jid'
                    }
                },
                {
                    mengyuanyuan: {
                        jid: 'easemob-demo#chatdemoui_wjy6@easemob.com',
                        name: 'wjy6',
                        order: '4',
                        type: 'jid',
                    }
                }
            ];
            conn.removeFromBlackList({
                list: list,
                type: 'jid',
                success: function () {
                    console.log('Remove from black list success.');
                },
                error: function () {
                    console.log('Remove from black list error.')
                }
            });
        };
    </script>
    <script>
        /*
        * Group
        */
        //创建群组
        var result = {}
        var resultCon = {}

        document.getElementById("createGroup").onclick = function () {
            var options = {
                data: {
                    groupname: 'testGroup111222',
                    desc: '这是测试创建群组',
                    members: ['1m1m'],
                    public: true,
                    approval: true,
                    allowinvites: false
                },
                success: function (respData) {

                    console.log("创建群组成功");
                    result = respData;
                    createConferId();
                    // setTimeout(() => {
                    //     sendCmdExt();
                    // }, 100)
                },
                error: function () {
                    console.log("创建群组失败");
                }
            };
            conn.createGroupNew(options);

        };

        //加入群组
        document.getElementById("joinGroup").onclick = function () {
            var options = {
                groupId: "72262379175937",
                success: function (resp) {
                    console.log("Response: ", resp);
                },
                error: function (e) {
                    if (e.type == 17) {
                        console.log("您已经在这个群组里了");
                    }
                }
            };
            conn.joinGroup(options);
        };

        // 列出当前登录用户加入的所有群组
        document.getElementById("getGroup").onclick = function () {
            var options = {
                success: function (resp) {
                    console.log("Response: ", resp)
                },
                error: function (e) { }
            }
            conn.getGroup(options);
        };

        //获取群组成员 通过rest
        document.getElementById('getGroupMember').onclick = function () {
            var pageNum = 1,
                pageSize = 1000;
            var options = {
                pageNum: pageNum,
                pageSize: pageSize,
                groupId: '77414068715521',
                success: function (resp) { console.log("Response: ", resp) },
                error: function (e) { }
            };
            conn.listGroupMember(options);
        }

        //群组文本消息
        document.getElementById("groupText").onclick = function () {
            var id = conn.getUniqueId();            // 生成本地消息id
            var msg = new WebIM.message('txt', id); // 创建文本消息
            var option = {
                msg: '测试群组消息',             // 消息内容
                to: result.data.groupid,                     // 接收消息对象(群组id)
                roomType: false,
                chatType: 'chatRoom',
                success: function () {
                    console.log('send room text success');
                },
                fail: function () {
                    console.log('failed');
                }
            };
            msg.set(option);
            msg.setGroup('groupchat');
            conn.send(msg.body);
            console.log(msg);
        };

        //群组图片消息
        document.getElementById("groupImg").onclick = function () {
            var id = conn.getUniqueId();                   // 生成本地消息id
            var msg = new WebIM.message('img', id);        // 创建图片消息
            var input = document.getElementById('gimg');  // 选择图片的input
            var file = WebIM.utils.getFileUrl(input);      // 将图片转化为二进制文件
            var allowType = {
                'jpg': true,
                'gif': true,
                'png': true,
                'bmp': true
            };
            if (file.filetype.toLowerCase() in allowType) {
                var option = {
                    apiUrl: WebIM.config.apiURL,
                    file: file,
                    to: '64951207133185',                       // 接收消息对象
                    roomType: false,
                    chatType: 'chatroom',
                    onFileUploadError: function () {      // 消息上传失败
                        console.log('onFileUploadError');
                    },
                    onFileUploadComplete: function () {   // 消息上传成功
                        console.log('onFileUploadComplete');
                    },
                    success: function () {                // 消息发送成功
                        console.log('发送群组图片消息成功');
                    },
                    fail: function () {
                        console.log('发送失败');
                    },
                    flashUpload: WebIM.flashUpload
                };
                msg.set(option);
                msg.setGroup('groupchat');
                conn.send(msg.body);
            }
        };
        //获取群组详情
        document.getElementById("getGroupInfo").onclick = function () {
            var options = {
                groupId: '77414068715521',
                success: function (resp) {
                    console.log("Response: ", resp);
                },
                error: function () {

                    console.log('获取失败');

                }
            };
            conn.getGroupInfo(options);

        };

        //修改群组信息
        document.getElementById("changeGroupInfo").onclick = function () {
            var option = {
                roomId: '64951207133185',
                subject: 'testGroup1',    // 群组名称
                description: 'Change group information test',  // 群组简介
                success: function () {
                    console.log('修改成功!');
                },
                error: function (e) {
                    console.log('修改失败');
                }
            };
            conn.changeGroupSubject(option);
        };

        //添加好友进群
        document.getElementById("addGroupMembers").onclick = function () {

            var option = {
                list: ['1z1z'],
                roomId: result.data.groupId
                // roomId: result.data.groupid
            };
            conn.addGroupMembers(option);
            console.log("邀请好友进群成功");
        };

        //将群组成员禁言
        document.getElementById("addMuteUser").onclick = function () {
            var options = {
                username: "1v1v",
                muteDuration: 886400000,
                groupId: "64951207133185",
                success: function (resp) {
                    console.log('禁言成功');
                },
                error: function (e) {
                    console.log('禁言失败');
                }
            };
            conn.mute(options); s
        };

        //移除群组成员禁言
        document.getElementById("removeMuteUser").onclick = function () {
            var options = {
                groupId: "64951207133185",
                username: "1v1v",
                success: function (resp) {
                    console.log('移除成功');
                },
                error: function (e) {
                    console.log('移除失败');
                }
            };
            conn.removeMute(options);
        };

        //获取群组禁言列表
        document.getElementById("getMuteList").onclick = function () {
            var options = {
                groupId: "64951207133185",
                success: function (resp) {
                    console.log('禁言成员:');
                    resp.data.forEach(function (user) {
                        console.log(user.user)
                    })
                },
                error: function (e) {
                    console.log('获取失败');
                }
            };
            conn.getMuted(options);
        };

        //设置群组管理员
        document.getElementById("setAdminUser").onclick = function () {
            var options = {
                groupId: "64951207133185",
                username: "1v1v",
                success: function (resp) {
                    console.log('设置管理员成功');
                },
                error: function (e) {
                    console.log('设置管理员失败');
                }
            };
            conn.setAdmin(options);
        };

        //取消群组管理员
        document.getElementById("removeAdminUser").onclick = function () {
            var options = {
                groupId: "64951207133185",
                username: "1v1v",
                success: function (resp) {
                    console.log('取消管理员成功');
                },
                error: function (e) {
                    console.log('取消管理员失败');
                }
            };
            conn.removeAdmin(options);

        };

        //获取群组管理员列表
        document.getElementById("getGroupAdmin").onclick = function () {
            var options = {
                groupId: "64951207133185",
                success: function (resp) {
                    console.log('管理员:');
                    resp.data.forEach(function (user) {
                        console.log(user)
                    })
                },
                error: function (e) {
                    console.log('获取失败');
                }
            };
            conn.getGroupAdmin(options);
        };

        //将群组成员拉入黑名单
        document.getElementById("groupBlockSingle").onclick = function () {
            var options = {
                groupId: "64951207133185",
                username: "1v1v",
                success: function (resp) {
                    console.log("Response: ", resp);
                },
                error: function (e) {
                    console.log('添加黑名单失败');
                }
            };
            conn.groupBlockSingle(options);

        };

        //将群组成员移除黑名单
        document.getElementById("removeGroupBlockSingle").onclick = function () {
            var options = {
                groupId: "64951207133185",
                username: "1v1v",
                success: function (resp) {
                    console.log("Response: ", resp);
                },
                error: function (e) {
                    console.log('移除失败');
                }
            }
            conn.removeGroupBlockSingle(options);

        };

        //退出群组
        document.getElementById("leaveGroup").onclick = function () {
            var options = {
                to: 'gdpwq123#rests_77412901650433@conference.easemob.com',
                roomId: '77412901650433',
                success: function () {
                    console.log('退出成功');
                },
                error: function () {
                    console.log('退出失败');
                }
            };
            conn.leaveGroupBySelf(options);
        };

        //// 解散一个群组
        document.getElementById("dissolveGroup").onclick = function () {

            var option = {
                groupId: result.data.groupid,
                success: function () {
                    console.log('解散成功');
                },
                error: function () {
                    console.log('解散失败');
                }
            };
            conn.dissolveGroup(option);

        }


    </script>
    <script>
        /*
        *Rooms
        */
        //获取聊天室列表
        document.getElementById("getRoomsList").onclick = function () {
            var option = {
                apiUrl: 'https://a1.easemob.com',
                pagenum: 1,                                 // 页数
                pagesize: 20,                               // 每页个数
                success: function (list) {
                    console.log(list);
                },
                error: function () {
                    console.log('获取失败');
                }
            };
            conn.getChatRooms(option);
        };

        //加入聊天室
        document.getElementById("joinRoom").onclick = function () {
            // 加入聊天室
            conn.joinChatRoom({
                roomId: '66676238385153',// 聊天室id
                success: function () {
                    console.log(new Date().toLocaleString());
                },
            });

        };

        //退出聊天室
        document.getElementById("quitRoom").onclick = function () {

            // 退出聊天室
            conn.quitChatRoom({
                roomId: '64843481677825' // 聊天室id
            });

        };

        //聊天室文本消息
        document.getElementById("roomText").onclick = function () {
            // 退出聊天室
            var id = conn.getUniqueId();
            var msg = new WebIM.message('txt', id);
            var option = {
                msg: '测试发送聊天室消息', // 消息内容
                to: '64843481677825', // 接收消息对象(本例为twy-room1聊天室)
                roomType: true,
                chatType: 'chatRoom',
                success: function () {
                    console.log('发送聊天室文本消息成功');
                    //console.log(msg);

                },
                fail: function () {
                    console.log('发送失败');
                }
            };
            msg.set(option);
            msg.setGroup('groupchat');
            conn.send(msg.body);
            console.log(msg);
        };

        //聊天室图片消息
        document.getElementById("roomImg").onclick = function () {
            var id = conn.getUniqueId();                   // 生成本地消息id
            var msg = new WebIM.message('img', id);        // 创建图片消息
            var input = document.getElementById('rimg');  // 选择图片的input
            var file = WebIM.utils.getFileUrl(input);      // 将图片转化为二进制文件
            var allowType = {
                'jpg': true,
                'gif': true,
                'png': true,
                'bmp': true
            };
            if (file.filetype.toLowerCase() in allowType) {
                var option = {
                    apiUrl: WebIM.config.apiURL,
                    file: file,
                    to: '64843481677825',                       // 接收消息对象
                    ext: {
                        "name": "张三",
                        "age": "18"
                    },
                    roomType: true,
                    chatType: 'chatroom',
                    onFileUploadError: function () {      // 消息上传失败
                        console.log('onFileUploadError');
                    },
                    onFileUploadComplete: function () {   // 消息上传成功
                        console.log('onFileUploadComplete');
                    },
                    success: function () {                // 消息发送成功
                        console.log('发送聊天室图片消息成功');
                    },
                    fail: function () {
                        console.log('发送失败');
                    },
                    flashUpload: WebIM.flashUpload
                };
                msg.set(option);
                msg.setGroup('groupchat');
                conn.send(msg.body);
            }
        };
    </script>
    <script>
        /*
         * WebRTC
         */
        // 视频呼叫对方

        // function rek() {
        //     rtcCall.caller = 'test3';
        //     var tname = document.getElementById("toname").value;
        //     rtcCall.makeVideoCall(tname);
        //     console.log("呼叫：" + tname)
        // }

        document.getElementById("rtCall").onclick = function () {
            var tname = document.getElementById("toname").value;

            rtcCall.caller = 'zdtest';
            rtcCall.makeVideoCall(tname);
            console.log("呼叫：" + tname)

        };
        // 关掉/拒绝视频
        document.getElementById("rtEndCall").onclick = function () {
            rtcCall.endCall();
        }
        // 接受对方呼叫
        document.getElementById("rtAcceptCall").onclick = function () {
            rtcCall.acceptCall();
        }
        // 语音呼叫对方
        document.getElementById("rtAudioCall").onclick = function () {
            var tname = document.getElementById("toname").value;
            console.log('Audio Call');
            rtcCall.caller = 'wenke123';
            rtcCall.makeVoiceCall(tname);
        };
    </script>
    <script>
        var resultCon = {}

        //创建会议
        document.getElementById("createConfer").onclick = function () {
            emedia.mgr.createConference(emedia.mgr.ConfrType.COMMUNICATION_MIX).then(function (confr) {
                console.log("创建会议成功");
                console.log(confr);
                resultCon = confr;
                emedia.mgr.joinConference(resultCon.confrId, resultCon.password, "加入").then(function (confr) {
                    console.log("加入成功");
                    var videoCreate = document.getElementById("video");
                    var constaints = { audio: true, video: true };
                    emedia.mgr
                        .publish(constaints, videoCreate, "发布视频流")
                        .then(function (pushedStream) {
                            //stream 对象
                        })
                        .catch(function (error) {
                            console.log(error);
                        });

                }).catch(function (error) {
                    console.log("加入失败");
                })
            }).catch(function (error) {
                console.log("创建会议失败");
            })
        }
        //发布视频流
        document.getElementById("pushVideo").onclick = function () {
            var videoPush = document.getElementById("video");
            var constaints = { audio: true, video: true };
            emedia.mgr
                .publish(constaints, videoPush, "创建者加入会议")
                .then(function (pushedStream) {
                    //stream 对象
                })
                .catch(function (error) {
                    console.log(error);
                });
        }
        //cmd 扩展邀请
        document.getElementById("inviteUser").onclick = function () {
            var uname = document.getElementById("name").value;
            var tname = document.getElementById("toname").value;
            var tmsg = document.getElementById("msg").value;
            var id = conn.getUniqueId();            //生成本地消息id
            var msg = new WebIM.message('cmd', id); //创建命令消息
            msg.set({
                msg: '邀请您加入会议' + result.confrId,
                to: tname,                       //接收消息对象
                action: 'action',                     //用户自定义，cmd消息必填
                ext: {
                    confrId: result.confrId,
                    password: result.password,
                    jid: WebIM.config.appkey + '_' + tname + '@' + WebIM.config.Host
                },
                success: function (id, serverMsgId) {
                    console.log('send private cmd Success');
                },
                fail: function (e) {
                    console.log("Send private cmd error");
                }
            })

            msg.body.chatType = 'singleChat';
            conn.send(msg.body);
        }
        //文本邀请
        document.getElementById("txtInviteUser").onclick = function () {
            var toname = document.getElementById("toname").value;
            var jid = WebIM.config.appkey + "_" + toname + "@" + WebIM.config.Host;
            rtcCall.inviteConference(resultCon.confrId, resultCon.password, jid);
        },


            //挂断视频
            document.getElementById("endConVideo").onclick = function () {
                var rtn = confirm("确定退出会议吗？");
                if (rtn) {
                    emedia.mgr.exit();
                }
            }

    </script>

</body>

</html>